diff --git a/docs/Usage.md b/docs/Usage.md index e349e4d..e115a91 100644 --- a/docs/Usage.md +++ b/docs/Usage.md @@ -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/' \ @@ -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/' \ diff --git a/scripts/NanoCaller.py b/scripts/NanoCaller.py index cfe5343..f589210 100644 --- a/scripts/NanoCaller.py +++ b/scripts/NanoCaller.py @@ -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): diff --git a/scripts/NanoCaller_WGS.py b/scripts/NanoCaller_WGS.py index a066b84..9880bd7 100644 --- a/scripts/NanoCaller_WGS.py +++ b/scripts/NanoCaller_WGS.py @@ -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)))