Skip to content

Commit

Permalink
Merge pull request #62 from grexor/devel
Browse files Browse the repository at this point in the history
Devel
  • Loading branch information
grexor authored Nov 26, 2024
2 parents e3f0f88 + 3f070ca commit 4172189
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions pybio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
pybio.core.genomes.init()

def genome_download(species, genome_version, args):
print(f"pybio | genome | download species {species} and version {genome_version}")
print(f"pybio | genome | download/check | {species} | {genome_version}")
pybio.core.genomes.genomes_present.setdefault(species, {}).setdefault(genome_version, {}).setdefault("assembly", False)
pybio.core.genomes.genomes_present.setdefault(species, {}).setdefault(genome_version, {}).setdefault("annotation", False)
assembly_folder = os.path.join(pybio.config.genomes_folder, f"{species}.assembly.{genome_version}")
Expand All @@ -42,7 +42,7 @@ def genome_download(species, genome_version, args):
else:
pybio.core.genomes.genomes_present[species][genome_version]["assembly"] = False
else:
print(f"pybio | genome | FASTA ready at {pybio.config.genomes_folder}/{species}.assembly.{genome_version}")
print(f"pybio | genome | assembly | {pybio.config.genomes_folder}/{species}.assembly.{genome_version}")

annotation_folder = os.path.join(pybio.config.genomes_folder, f"{species}.annotation.{genome_version}")
if not pybio.core.genomes.genomes_present.get(species, {}).get(genome_version, {}).get("annotation", False) or not os.path.exists(annotation_folder):
Expand All @@ -57,7 +57,7 @@ def genome_download(species, genome_version, args):
else:
pybio.core.genomes.genomes_present[species][genome_version]["annotation"] = False
else:
print(f"[pybio genome] genome annotation at {pybio.config.genomes_folder}/{species}.annotation.{genome_version}")
print(f"pybio | genome | annotation | {pybio.config.genomes_folder}/{species}.annotation.{genome_version}")

#json.dump(pybio.core.genomes.genomes_present, open(os.path.join(pybio.config.genomes_folder, "genomes_ready.json"), "wt"), indent=4)

Expand Down Expand Up @@ -87,7 +87,7 @@ def genome_import(species, genome_version, args):
annotation_folder = os.path.join(pybio.config.genomes_folder, f"{species}.annotation.{genome_version}")
if not pybio.core.genomes.genomes_present.get(species, {}).get(genome_version, {}).get("annotation", False) or not os.path.exists(annotation_folder):
gtf_fname = args.gtf
print(f"[pybio genome] importing {gtf_fname} to {annotation_folder}/{species}.gtf.gz")
print(f"pybio | genome | importing {gtf_fname} to {annotation_folder}/{species}.gtf.gz")
if gtf_fname.endswith(".gz"):
os.system(f"mkdir {annotation_folder}; cp {gtf_fname} {annotation_folder}/{species}.gtf.gz; gunzip -f {annotation_folder}/{species}.gtf.gz")
else:
Expand Down Expand Up @@ -121,7 +121,7 @@ def genome_prepare(species, genome_version, args):
else:
pybio.core.genomes.genomes_present[species][genome_version]["STAR"] = False
else:
print(f"pybio | genome | STAR index ready at {pybio.config.genomes_folder}/{species}.assembly.{genome_version}.star")
print(f"pybio | genome | STAR index | {pybio.config.genomes_folder}/{species}.assembly.{genome_version}.star")

if pybio.utils.is_tool("salmon") and not args.nosalmon:
salmon_folder = os.path.join(pybio.config.genomes_folder, f"{species}.transcripts.{genome_version}.salmon")
Expand All @@ -137,7 +137,7 @@ def genome_prepare(species, genome_version, args):
else:
pybio.core.genomes.genomes_present[species][genome_version]["salmon"] = False
else:
print(f"pybio | genome | salmon index ready at {pybio.config.genomes_folder}/{species}.transcripts.{genome_version}.salmon")
print(f"pybio | genome | salmon index | {pybio.config.genomes_folder}/{species}.transcripts.{genome_version}.salmon")

#json.dump(pybio.core.genomes.genomes_present, open(os.path.join(pybio.config.genomes_folder, "genomes_ready.json"), "wt"), indent=4)

Expand Down
2 changes: 1 addition & 1 deletion pybio/pybio
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def handle_genome(args):
if len(potential_hits)>1:
display_potential_hits(potential_hits, species)
if genome_version==None:
print("Please provide a custom or valid Ensembl genome version, examples: custom_genome_v1 / ensembl113 / ensemblgenomes57")
print("Could not identify species name.\n")
sys.exit(1)
if genome_version.find("ensembl")!=-1:
pybio.genome_download(species, genome_version, args)
Expand Down

0 comments on commit 4172189

Please sign in to comment.