Skip to content

Commit 4f46a44

Browse files
committed
update track hubs
1 parent 63629be commit 4f46a44

File tree

1,381 files changed

+1847
-1483
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,381 files changed

+1847
-1483
lines changed

14_track_hub.ipynb

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@
1313
" - `communities/`: Contains all the files that will be generated following the code in this notebook.\n",
1414
" - `bedToBigBed`: Program to convert .bed to bigBed format as explained here: https://genome.ucsc.edu/goldenPath/help/bigBed.html\n",
1515
" - `genomes.txt` / `hub.txt`: Files needed for Tracking Hub\n",
16-
" - `hg19.chrom.size`: File needed to execute this notebook, downloaded from https://genome.ucsc.edu/goldenPath/help/bigBed.html\n",
16+
" - `hg38.chrom.size`: File needed to execute this notebook, downloaded from https://github.com/igvteam/igv/blob/master/genomes/sizes/hg38.chrom.sizes\n",
1717
" - `process_beds.sh`: Script that will convert all .bed files to bigBed format, deleting all .bed files. In practice, it executes Example \\#2 from this link: https://genome.ucsc.edu/goldenPath/help/bigBed.html\n",
1818
"\n",
1919
"\n",
20-
"Link provided to Track Hub: https://raw.githubusercontent.com/tjiagoM/gtex-transcriptome-modelling/master/track_hub/hub.txt"
20+
"The link provided to Track Hub is: https://raw.githubusercontent.com/tjiagoM/gtex-transcriptome-modelling/master/track_hub/hub.txt\n",
21+
"\n",
22+
"For a complete set of genes for all communities, we also provide the file `outputs/all_communities_genes.txt`. Unfortunately, some genes did not have a mapping resulting from the code in this notebook, therefore the tracking hub contains an incomplete set of genes. Instead, `all_communities_genes.txt` is complete. As in the paper, we only consider communities with more then 3 genes."
2123
]
2224
},
2325
{
@@ -56,7 +58,7 @@
5658
"# Saving the chromosome's limits, based on the file `hg19.chrom.sizes` downloaded from https://genome.ucsc.edu/goldenPath/help/bigBed.html\n",
5759
"\n",
5860
"chr_limits = dict()\n",
59-
"with open('track_hub/hg19.chrom.sizes', 'r') as reader:\n",
61+
"with open('track_hub/hg38.chrom.sizes', 'r') as reader:\n",
6062
" lines = reader.readlines()\n",
6163
" for line in lines:\n",
6264
" line_info = line.split('\\t')\n",
@@ -104,26 +106,26 @@
104106
},
105107
{
106108
"cell_type": "code",
107-
"execution_count": 5,
109+
"execution_count": 6,
108110
"metadata": {},
109111
"outputs": [],
110112
"source": [
111-
"with open('track_hub/communities/trackDb.txt', 'w') as f_track_hubs:\n",
113+
"with open('track_hub/hg38/trackDb.txt', 'w') as f_track_hubs:\n",
112114
" for tissue in TISSUES:\n",
113115
" try:\n",
114116
" for community_id in range(1, 999999):\n",
115117
" arr_com = []\n",
116118
" dic_community = pickle.load(open(\"svm_results/\" + tissue + '_' + str(community_id) + \".pkl\", \"rb\"))\n",
117119
" len_common = len(dic_community['genes'])\n",
118120
"\n",
119-
" with open(f'track_hub/communities/{tissue}_{community_id}.bed', 'w') as f:\n",
121+
" with open(f'track_hub/hg38/{tissue}_{community_id}.bed', 'w') as f:\n",
120122
" for gene in dic_community['genes']:\n",
121123
" if gene in dic_all_genes_info.keys():\n",
122124
" gene_info = dic_all_genes_info[gene]\n",
123125
" f.write(f'{gene_info[\"chr\"]}\\t{gene_info[\"chr_start\"]}\\t{gene_info[\"chr_end\"]}\\n')\n",
124126
" \n",
125127
" f_track_hubs.write(f'track {tissue}_{community_id}\\n')\n",
126-
" f_track_hubs.write(f'bigDataUrl https://raw.githubusercontent.com/tjiagoM/gtex-transcriptome-modelling/master/track_hub/communities/{tissue}_{community_id}.bb\\n')\n",
128+
" f_track_hubs.write(f'bigDataUrl https://raw.githubusercontent.com/tjiagoM/gtex-transcriptome-modelling/master/track_hub/hg38/{tissue}_{community_id}.bb\\n')\n",
127129
" f_track_hubs.write(f'shortLabel {tissue}_{community_id}\\n')\n",
128130
" f_track_hubs.write(f'longLabel {tissue}_{community_id}\\n')\n",
129131
" f_track_hubs.write(f'type bigBed\\n')\n",

track_hub/hg19.chrom.sizes

Lines changed: 0 additions & 93 deletions
This file was deleted.

0 commit comments

Comments
 (0)