Hi all,I have already looked up for similar questions but I did not find what I am looking for. I have two questions:
1.I want to trim the primers for 12 fastq files and I am using this loop
for i in $(ls):; do cutadapt -a TCCTCCGCTTATTGATAGC -o ${i}trimmed.fastq ${i}; done
but the outfile name that I get is e.g C1P1.fastqtrimmed.fastq, how do I write the script in the way that I get C1P1_trimmed.fastq as the output file name?
I would like to do the same thing with vsearch, so process a number of files in one time. I use
for i in *$(ls):; do vsearch --rereplicate ${i} --relabel ${i}seq --output ${i}.fasta; done
but I would like to use these comands just for some fasta files in the directory not all the files of the directory. thanks a lot in advance.
thanks a lot for your answer! no, I am not able, I tried few things but I did not get it right.. Could you tell me how is it done? thank you so much for your help!
Without knowing your file names/what exactly you want to select it would be difficult. Look at this page to see if you are able to identify a pattern that works for you with
ls
.Thanks, i will look at it!
I changed the -o ${i}_trimmed.fastq but I still get C1P1.fastq_trimmed.fastq instead of C1P1_trimmed.fastq...
Ah I see. Replace
ls
withls | sed 's/.fastq//'
. Your command would becomeit worked! great, thanks a lot!