Generate and query genome 3D stucture (.g3d) file
Project description
g3dtools
A tool for operating .g3d (genome 3D structure) format, for more information please check documentation.
Require: Python (Recommend version 3 and above).
example input, 6 columns bed-like text file (6th column is optional):
chr7 16760000 -14.3866688728 -36.3919302029 19.8483965881 m
chr7 16760000 -24.9116268071 50.0521268287 9.91073185128 p
chr7 25160000 -10.1170055526 -34.8975763469 20.2401719179 m
chr7 25160000 -21.8210915649 27.1128556621 13.4856945965 p
chr7 33540000 -4.11059384846 -54.4940083464 4.21321135564 m
chr7 33540000 -12.0040359857 31.5960497183 26.6925954134 p
chr7 41940000 5.75342635105 -55.4976428728 8.65307697332 m
chr7 41940000 -23.7372022413 36.0614692267 31.919119243 p
chr7 50320000 -10.7099779927 -38.0214001171 25.8308473821 m
chr7 50320000 -28.5142098162 26.6468499001 28.8634805533 p
chr7 26200000 -11.5800097945 -37.9903257744 16.2461100893 m
chr7 26200000 -15.9552426623 27.016940724 17.5722080595 p
chr7 27260000 -14.1883124179 -44.7860807973 12.4104162757 m
chr7 27260000 -20.0857754297 30.9204143041 18.4774635708 p
chr7 28300000 -18.0160836669 -39.398544495 12.811858164 m
chr7 28300000 -14.9383020843 39.1464516779 17.3743509519 p
chr7 29360000 -11.8032470923 -47.3595095319 13.2828128833 m
chr7 29360000 -12.2445277916 41.2431968179 14.8844908717 p
chr7 30400000 -12.8674349856 -45.0752589744 9.15498568359 m
columns are:
- chromosome
- start position
- X (coordinates in 3D)
- Y
- Z
- category (optional), usually haplotype or cell/sample type, or time point information can be used, like for haplotype,
mformaternal,pforpaternal,sforshared, if omitted,sharedwill be used, or user can choosecell-1,cell-2etc. for cell identifier...
This file input looks simiar to 3dg format except we put haplotype or category info on last column.
Generate a new .g3d file using the format listed above
g3dtools load ../test/test.g3d.bed.gz -o ../testOut/test -s 2,3,4,5,6,7,8,9,10 -n GM12878 -g hg19
Generate a new .g3d file from .3dg format
Input a file with high resolution, let the tool calculate lower resolutions:
g3dtools 3dg ../test/GSM3271347_gm12878_01.impute3.round4.clean.3dg.txt.gz -o ../testOut/GSM3271347_gm12878_01.impute3.round4.clean -n GM12878 -g hg19 -s 2,3,4,5,6,7,8,9,10
or prepare different resolution files in advance.
Generate a new .g3d file from PASTIS output
User can also generate .g3d file from pastis output.
g3dtools pastis -g Pfal3D7 -n Rings -o ../testOut/rings ../test/RINGS.3D_coord.txt
g3dtools pastis-pdb -g Pfal3D7 -n Rings -o ../testOut/rings_pdb -s 2,3,4,5,6 ~/Downloads/RINGS.pdb
Generate a new .g3d from nucle3d format
User can also generate .g3d file from nucle3d format.
g3dtools nucle3d -n k562 -g hg38 -o ../testOut/k562 ../test/K562.nucle3d
Query
By region:
g3dtools query testOut/test.g3d -c chr7 -s 27053397 -e 27373765
change haplotype (or category):
g3dtools query -c chr7 -s 500000 -e 50000000 -y paternal ../testOut/test2.g3d > x
change resolution:
g3dtools query testOut/test.g3d -c chr7 -s 27053397 -e 27373765 -r 100000
when resolution not exists:
$ g3dtools query testOut/test.g3d -c chr7 -s 27053397 -e 27373765 -r 130000
[Query] Error, resolution 130000 not exists for this file,
available resolutions: [20000, 40000, 60000, 80000, 100000, 120000, 140000, 160000, 180000, 200000]
Get metadata information
g3dtools meta testOut/test2.g3d
{
"version": 2,
"genome": "hg19",
"name": "GM12878",
"resolutions": [
20000,
40000,
60000,
80000,
100000,
120000,
140000,
160000,
180000,
200000
],
"categories": [
"maternal",
"paternal"
]
}
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file g3dtools-0.2.3.tar.gz.
File metadata
- Download URL: g3dtools-0.2.3.tar.gz
- Upload date:
- Size: 13.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.4.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
34b46b2d28999e26d9fdac0565de16280b64cd03ff8ab84405164313d279a136
|
|
| MD5 |
aeb7a74459798519440b4456ccedd64c
|
|
| BLAKE2b-256 |
3fb470d13ea66d7849ab76e2e64bbfb132f1f43394a927a25ceb41109fb63c86
|
File details
Details for the file g3dtools-0.2.3-py3-none-any.whl.
File metadata
- Download URL: g3dtools-0.2.3-py3-none-any.whl
- Upload date:
- Size: 18.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.4.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
91102bdad278160a08303c7b0b676c4eec52c155f1d6d77b42c7b666380f2ecc
|
|
| MD5 |
35a8b9525e94cfae03f29a05845ffc01
|
|
| BLAKE2b-256 |
f5dd01972047423d91d4bef9988f1ba684a73d7db7cfad6f197c65dce7fcbe27
|