Skip to content

Commit

Permalink
[MRG] Fix README Tutorial Example (#109)
Browse files Browse the repository at this point in the history
* Fix README Tutorial Example

* Fix indentation 

Unrelated to the main PR purpose, but I spotted it while working and adding it here because it's minor.
  • Loading branch information
mr-eyes authored Nov 3, 2021
1 parent 68f2bbb commit 2589163
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ curl -L https://osf.io/4n3m5/download -o gtdb-r95.nucleotide-k31-scaled1000.sbt.
Put the following in a config file named `conf-tutorial.yml`:
```
sample:
- HSMA33MX
- SRR5950647
outdir: outputs.tutorial/
metagenome_trim_memory: 1e9
sourmash_database_glob_pattern: gtdb-r95.nucleotide-k31-scaled1000.sbt.zip
Expand Down
46 changes: 23 additions & 23 deletions genome_grist/conf/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -776,29 +776,29 @@ rule make_combined_info_csv:

# download actual genomes!
rule download_matching_genome_wc:
input:
csvfile = ancient('genbank_genomes/{acc}.info.csv')
output:
genome = "genbank_genomes/{acc}_genomic.fna.gz"
run:
with open(input.csvfile, 'rt') as infp:
r = csv.DictReader(infp)
rows = list(r)
assert len(rows) == 1
row = rows[0]
acc = row['acc']
assert wildcards.acc.startswith(acc)
url = row['genome_url']
name = row['ncbi_tax_name']

print(f"downloading genome for acc {acc}/{name} from NCBI...",
file=sys.stderr)
with open(output.genome, 'wb') as outfp:
with urllib.request.urlopen(url) as response:
content = response.read()
outfp.write(content)
print(f"...wrote {len(content)} bytes to {output.genome}",
file=sys.stderr)
input:
csvfile = ancient('genbank_genomes/{acc}.info.csv')
output:
genome = "genbank_genomes/{acc}_genomic.fna.gz"
run:
with open(input.csvfile, 'rt') as infp:
r = csv.DictReader(infp)
rows = list(r)
assert len(rows) == 1
row = rows[0]
acc = row['acc']
assert wildcards.acc.startswith(acc)
url = row['genome_url']
name = row['ncbi_tax_name']

print(f"downloading genome for acc {acc}/{name} from NCBI...",
file=sys.stderr)
with open(output.genome, 'wb') as outfp:
with urllib.request.urlopen(url) as response:
content = response.read()
outfp.write(content)
print(f"...wrote {len(content)} bytes to {output.genome}",
file=sys.stderr)


# summarize_reads_info
Expand Down

0 comments on commit 2589163

Please sign in to comment.