CNSAnalysis/CNS_commandline.py
def annotate_snps(vcf_in,genome_name,fasta_in,gff_in,vcf_out):
    """Goal is to find synonymous and non-synonymous regions of SNPs"""
    # format gff in
    #subprocess.call('grep -v "#" %s | sort -k1,1 -k2,2n -k3,3n -t$\'\t\' | bgzip -c > %s.gz && tabix -p gff %s.gz'%(gff_in,gff_in,gff_in),shell=True)
    snp_eff_line = next(path for path in sys.path if 'conda/' in path and '/lib/' in path).split('/lib/')[0]+'/share/snpeff-4.3.1r-0/snpEff.config'
    subprocess.call('scp %s . && mkdir -p ./data/%s'%(snp_eff_line,genome_name),shell=True)
    with open('snpEff.config','r') as f:
        write = 0
        writeLines = []
        for line in f:
            if 'Databases & Genomes' in line:
                write = 1
            writeLines.append(line)
            if write and '#-----------------------------' in line:
                writeLines.append('\n# my %s genome\n%s.genome : %s\n'%(genome_name,genome_name,genome_name))
                write = 0
    with open('snpEff.config','w') as f:
        f.writelines(writeLines)
    subprocess.call('scp %s ./data/%s/sequences.fa && scp %s ./data/%s/genes.gff'%(fasta_in,genome_name,gff_in,genome_name),shell=True)
    subprocess.call('snpEff build -c snpEff.config -gff3 -v %s > snpEff.stdout 2> snpEff.stderr'%genome_name,shell=True)
    subprocess.call('snpEff -c snpEff.config %s %s > %s'%(genome_name,vcf_in,vcf_out),shell=True)
Goal is to find synonymous and non-synonymous regions of SNPs
Goal is to find synonymous and non-synonymous regions of SNPs
Goal is to find synonymous and non - synonymous regions of SNPs
def annotate_snps(vcf_in,genome_name,fasta_in,gff_in,vcf_out):
    snp_eff_line = next(path for path in sys.path if 'conda/' in path and '/lib/' in path).split('/lib/')[0]+'/share/snpeff-4.3.1r-0/snpEff.config'
    subprocess.call('scp %s . && mkdir -p ./data/%s'%(snp_eff_line,genome_name),shell=True)
    with open('snpEff.config','r') as f:
        write = 0
        writeLines = []
        for line in f:
            if 'Databases & Genomes' in line:
                write = 1
            writeLines.append(line)
            if write and '#-----------------------------' in line:
                writeLines.append('\n# my %s genome\n%s.genome : %s\n'%(genome_name,genome_name,genome_name))
                write = 0
    with open('snpEff.config','w') as f:
        f.writelines(writeLines)
    subprocess.call('scp %s ./data/%s/sequences.fa && scp %s ./data/%s/genes.gff'%(fasta_in,genome_name,gff_in,genome_name),shell=True)
    subprocess.call('snpEff build -c snpEff.config -gff3 -v %s > snpEff.stdout 2> snpEff.stderr'%genome_name,shell=True)
    subprocess.call('snpEff -c snpEff.config %s %s > %s'%(genome_name,vcf_in,vcf_out),shell=True)
def annotate_snps ( vcf_in , genome_name , fasta_in , gff_in , vcf_out ) : snp_eff_line = next ( path for path in sys . path if 'conda/' in path and '/lib/' in path ) . split ( '/lib/' ) [ 0 ] + '/share/snpeff-4.3.1r-0/snpEff.config' subprocess . call ( 'scp %s . && mkdir -p ./data/%s' % ( snp_eff_line , genome_name ) , shell = True ) with open ( 'snpEff.config' , 'r' ) as f : write = 0 writeLines = [ ] for line in f : if 'Databases & Genomes' in line : write = 1 writeLines . append ( line ) if write and '#-----------------------------' in line : writeLines . append ( '\n# my %s genome\n%s.genome : %s\n' % ( genome_name , genome_name , genome_name ) ) write = 0 with open ( 'snpEff.config' , 'w' ) as f : f . writelines ( writeLines ) subprocess . call ( 'scp %s ./data/%s/sequences.fa && scp %s ./data/%s/genes.gff' % ( fasta_in , genome_name , gff_in , genome_name ) , shell = True ) subprocess . call ( 'snpEff build -c snpEff.config -gff3 -v %s > snpEff.stdout 2> snpEff.stderr' % genome_name , shell = True ) subprocess . call ( 'snpEff -c snpEff.config %s %s > %s' % ( genome_name , vcf_in , vcf_out ) , shell = True )
Goal is to find synonymous and non-synonymous regions of SNPs
Goal is to find synonymous and non - synonymous regions of SNPs
"""Goal is to find synonymous and non-synonymous regions of SNPs""" # format gff in #subprocess.call('grep -v "#" %s | sort -k1,1 -k2,2n -k3,3n -t$\'\t\' | bgzip -c > %s.gz && tabix -p gff %s.gz'%(gff_in,gff_in,gff_in),shell=True)
vcf_in
genome_name
fasta_in
gff_in
vcf_out