Skip to content

Commit

Permalink
bugs fixed in chromosome notation
Browse files Browse the repository at this point in the history
  • Loading branch information
umahsn committed Jan 15, 2021
1 parent f6e585e commit 9f0f933
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/Usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

For whole genome variant calling, or calling variants on several chromosomes, use `NanoCaller_WGS.py` to call variants. Assuming all your input files are in a folder `YOUR_INPUT_DIR`, and you want to use `YOUR_OUTPUT_DIR` to store the results.
```
VERSION=0.3.1
VERSION=0.3.2
docker run -itd \
-v 'YOUR_INPUT_DIR':'/input/' \
-v 'YOUR_WORKING_DIR':'/output/' \
Expand All @@ -23,7 +23,7 @@ python NanoCaller_WGS.py \

For calling variants on single chromosomes, use `NanoCaller.py` to call variants. Assuming all your input files are in a folder `YOUR_INPUT_DIR`, and you want to use `YOUR_OUTPUT_DIR` to store the results.
```
VERSION=0.3.1
VERSION=0.3.2
docker run -itd \
-v 'YOUR_INPUT_DIR':'/input/' \
-v 'YOUR_WORKING_DIR':'/output/' \
Expand Down
2 changes: 1 addition & 1 deletion scripts/NanoCaller.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def run(args):
os.remove('%s.phased.bam' %snp_vcf)

print('%s: Post processing' %(str(datetime.datetime.now())),flush=True)
run_cmd('samtools faidx %s %s>%s/%s.fa' %(args.ref,args.chrom,args.output,args.chrom))
run_cmd('samtools faidx %s %s > %s/%s.fa' %(args.ref,args.chrom,args.output,args.chrom))

if os.path.exists('%s/ref.sdf' %args.output):
if os.path.isdir('%s/ref.sdf' %args.output):
Expand Down
7 changes: 6 additions & 1 deletion scripts/NanoCaller_WGS.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,12 @@

dirname = os.path.dirname(__file__)

chr_end=chrom_lengths[chrom]
try:
chr_end=chrom_lengths[chrom]

except KeyError:
print('Contig %s not found in reference' %chrom,flush=True)
continue
for mbase in range(1,chr_end,10000000):
out_path=os.path.join(args.output, 'intermediate_files', '%s_%d_%d' %(chrom, mbase, min(chr_end,mbase+10000000-1)))
wg_commands.write('python %s -chrom %s %s -cpu 1 --output %s -start %d -end %d -prefix %s_%d_%d\n' %(os.path.join(dirname,'NanoCaller.py'), chrom, cmd, out_path ,mbase, min(chr_end,mbase+10000000-1),chrom, mbase, min(chr_end,mbase+10000000-1)))
Expand Down

0 comments on commit 9f0f933

Please sign in to comment.