view testdep.py @ 0:500ceb70e4bd draft

planemo upload commit d4d558b27a09f684be8311f3cfb659b16545e167-dirty
author charles_s_test
date Sun, 12 Nov 2017 09:12:36 -0500
parents
children
line wrap: on
line source


import sys, os, io

#input = sys.argv[1]

print(input)

import re, os

def fix_seq_ids(filename):
        '''
        make sequence ids the same for paired reads.
        '''
        file = list(open(filename, 'r'))
        new_file = open(filename, 'w')
        for line in file:
                if re.search('^@', line) or re.search('^\+', line) and re.search(' ', line):
                        linel = re.split(' ', line)
                        linel[0] = re.sub('.\d$', '', linel[0])
                        line = ' '.join(linel)
                new_file.write(line)
# fastq-dump --log-level fatal --split-3 --accession accession_number --ncbi_error_report never

#os.system('bwa index -a bwtsw /nfs/sw/apps/galaxy-dev/galaxy/database/files/000/dataset_454.dat')
os.system('samtools view -bS /nfs/sw/apps/galaxy-dev/galaxy/database/files/000/dataset_472.dat > test.bam')

os.system('blastx -query /nfs/sw/apps/galaxy-dev/galaxy/database/files/000/dataset_454.dat -out output.blast.txt')


file = open("test.txt","w") 
 
file.write("Hello World") 
 
file.close() 

#os.system('/nfs/sw/apps/bwa/bwa-0.7.15/bwa index -a bwtsw /nfs/sw/apps/galaxy-dev/galaxy/database/files/000/dataset_454.dat')



#os.system('bwa mem /nfs/sw/apps/galaxy-dev/galaxy/tools/seqsero/database/fliC_b_whole.fasta /nfs/sw/apps/galaxy-dev/galaxy/database/files/000/dataset_445.dat /nfs/sw/apps/galaxy-dev/galaxy/database/files/000/dataset_446.dat > aln-pe.sam')

#os.system('/nfs/sw/apps/sratoolkit/sratoolkit.2.8.0-centos_linux64/bin/fastq-dump --log-level fatal --split-3 --accession ' + input + ' --ncbi_error_report never')

#os.system('ls -lh | grep ' + input)

#os.system('/nfs/sw/apps/sratoolkit/sratoolkit.2.8.0-centos_linux64/bin/fastq-dump -I --split-files ' + input)
#mv_cmd = 'mv -v ' + input + '_1.fastq R1.fastq'
#print(mv_cmd)

#fix_seq_ids(input + '_1.fastq')
#fix_seq_ids(input + '_2.fastq')

#os.system('mv -v ' + input + '_1.fastq R1.fastq')
#os.system('mv -v ' + input + '_2.fastq R2.fastq')