Skip to content

Commit 04c5e26

Browse files
committed
added hierarchical categories #36
1 parent b0f69bc commit 04c5e26

File tree

1 file changed

+2
-39
lines changed

1 file changed

+2
-39
lines changed

scripts/process_collections.py

Lines changed: 2 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -198,33 +198,13 @@ def process_collections(self, cmds_only, mode):
198198

199199
if mode == "jbrowse": # for jbrowse
200200
if url.endswith("bw"):
201-
202-
# print("\nCollection_type:dsfile: \n: ",self.files[collection_type][dsfile])
203-
204201
bw_name = self.files[collection_type][dsfile].get(
205202
"name", None
206203
)
207204
bw_id = bw_name.split(".")[-2:]
208205
project_id = ".".join(bw_name.split(".")[1:-2])
209-
210-
# cmd = f'jbrowse add-track {bw_name} --assemblyNames {name} --out {os.path.abspath(self.out_dir)} --load copy --force'
211206
cmd = f"jbrowse add-track {url} --name {bw_id[0]} --assemblyNames {parent[0]} --category expression,{project_id} --out {os.path.abspath(self.out_dir)} --force"
212-
#cmd = f"jbrowse add-track {self.from_github}/{genus}/{species}/expression/{project_id}/{bw_name} --name {bw_id[0]} --assemblyNames {parent[0]} --load copy --out {os.path.abspath(self.out_dir)} --force"
213-
"""
214-
dis_name = self.files[collection_type][dsfile].get(
215-
"name", None
216-
)
217-
print("disname is: ", dis_name)
218-
# path = (f'{self.from_github}/{genus}/{species}/expression/')
219-
if os.path.exists(f'{self.from_github}/{genus}/{species}/expression/'):
220-
print("Directory exists!")
221-
for fname in os.listdir(f'{self.from_github}/{genus}/{species}/expression/'):
222-
# looks at for bigwigs of matching strain:
223-
if fname.endswith(f'{dis_name}.bw'):
224-
print("\nFound big wig: ", fname, "\n")
225-
cmd = f'jbrowse add-track {self.from_github}/{genus}/{species}/expression/{fname} --assemblyNames {name} --out {os.path.abspath(self.out_dir)} --force'
226-
else: continue
227-
"""
207+
228208
elif mode == "blast": # for blast
229209
continue # Not blastable at the moment
230210

@@ -238,23 +218,6 @@ def process_collections(self, cmds_only, mode):
238218
cmd, shell=True, executable="/bin/bash"
239219
): # execute cmd and check exit value = 0
240220
logger.error(f"Non-zero exit value: {cmd}")
241-
"""
242-
if os.path.exists(f'{self.from_github}/{genus}/{species}/expression/'):
243-
dis_name = self.files[collection_type][dsfile].get("name", None)
244-
for fname in os.listdir(f'{self.from_github}/{genus}/{species}/expression/'):
245-
246-
247-
if fname.endswith(f'{dis_name}.bw'):
248-
249-
print("\nBigwig file found: ", fname, "\n")
250-
# captures display name to match with potential bigwig files
251-
252-
cmd2 = f'jbrowse add-track {self.from_github}/{genus}/{species}/expression/{fname} --assemblyNames {name} --load copy --out {os.path.abspath(self.out_dir)} --force'
253-
if subprocess.check_call(
254-
cmd2, shell=True, executable="/bin/bash"
255-
):
256-
logger.error(f'Couldn\'t add bigwig')
257-
"""
258221

259222
def populate_jbrowse2(self, out_dir, cmds_only=False):
260223
"""Populate jbrowse2 config object from collected objects"""
@@ -705,7 +668,7 @@ def add_collections(self, collection_type, genus, species):
705668
), # url encode for .yml file and Jekyll linking
706669
"description": "JBrowse2 Linear Genome View",
707670
} # the object that will be written into the .yml file
708-
# print(f"linear data: {linear_data}")
671+
709672
if strain_lookup not in self.infraspecies_resources:
710673
self.infraspecies_resources[strain_lookup] = (
711674
[]

0 commit comments

Comments
 (0)