Mercurial > repos > charles_s_test > test_dependencies
comparison 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 |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:500ceb70e4bd |
|---|---|
| 1 | |
| 2 import sys, os, io | |
| 3 | |
| 4 #input = sys.argv[1] | |
| 5 | |
| 6 print(input) | |
| 7 | |
| 8 import re, os | |
| 9 | |
| 10 def fix_seq_ids(filename): | |
| 11 ''' | |
| 12 make sequence ids the same for paired reads. | |
| 13 ''' | |
| 14 file = list(open(filename, 'r')) | |
| 15 new_file = open(filename, 'w') | |
| 16 for line in file: | |
| 17 if re.search('^@', line) or re.search('^\+', line) and re.search(' ', line): | |
| 18 linel = re.split(' ', line) | |
| 19 linel[0] = re.sub('.\d$', '', linel[0]) | |
| 20 line = ' '.join(linel) | |
| 21 new_file.write(line) | |
| 22 # fastq-dump --log-level fatal --split-3 --accession accession_number --ncbi_error_report never | |
| 23 | |
| 24 #os.system('bwa index -a bwtsw /nfs/sw/apps/galaxy-dev/galaxy/database/files/000/dataset_454.dat') | |
| 25 os.system('samtools view -bS /nfs/sw/apps/galaxy-dev/galaxy/database/files/000/dataset_472.dat > test.bam') | |
| 26 | |
| 27 os.system('blastx -query /nfs/sw/apps/galaxy-dev/galaxy/database/files/000/dataset_454.dat -out output.blast.txt') | |
| 28 | |
| 29 | |
| 30 file = open("test.txt","w") | |
| 31 | |
| 32 file.write("Hello World") | |
| 33 | |
| 34 file.close() | |
| 35 | |
| 36 #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') | |
| 37 | |
| 38 | |
| 39 | |
| 40 #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') | |
| 41 | |
| 42 #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') | |
| 43 | |
| 44 #os.system('ls -lh | grep ' + input) | |
| 45 | |
| 46 #os.system('/nfs/sw/apps/sratoolkit/sratoolkit.2.8.0-centos_linux64/bin/fastq-dump -I --split-files ' + input) | |
| 47 #mv_cmd = 'mv -v ' + input + '_1.fastq R1.fastq' | |
| 48 #print(mv_cmd) | |
| 49 | |
| 50 #fix_seq_ids(input + '_1.fastq') | |
| 51 #fix_seq_ids(input + '_2.fastq') | |
| 52 | |
| 53 #os.system('mv -v ' + input + '_1.fastq R1.fastq') | |
| 54 #os.system('mv -v ' + input + '_2.fastq R2.fastq') |
