Question: bwa for multiple fastq files
gravatar for dmotelb87
11 months ago by
dmotelb8710 wrote:

I would like to do bwa annotation for forward and reverse reads from different samples against a reference genome using for loap

I have different samples like:

A2_forward.fastq A2_reverse.fastq A3_forward.fastq A3_reverse.fastq A4_forward.fastq A4_reverse.fastq

Also, I need the output for annotation of each sample in separate, as I need to compare the effects of different treatments in different samples.

bwa aligner • 1.0k views
ADD COMMENTlink modified 11 months ago • written 11 months ago by dmotelb8710

Thanks Suraj. Yes. This what I mean. It is working now.

ADD REPLYlink written 11 months ago by dmotelb8710

If an answer was helpful you should upvote it, if the answer resolved your question you should mark it as accepted. Upvote|Bookmark|Accept

Please use ADD COMMENT or ADD REPLY to answer to previous reactions, as such this thread remains logically structured and easy to follow. I have now moved your reaction but as you can see it's not optimal. Adding an answer should only be used for providing a solution to the question asked.

ADD REPLYlink written 11 months ago by WouterDeCoster36k
gravatar for MSM55
11 months ago by
MSM5590 wrote:

Do you men to say, you want to do mapping of different sample against your reference genome ? You can use following script for mapping multiple sample using bwa. (Note: save the below script in .sh format (say "") and make sure that are no other fastq file rather then your sample should be there in your working directory)

script for mapping using bwa mem

total_files=`find -name '*.fastq' | wc -l`
arr=( $(ls *.fastq) )
echo "mapping started" >> map.log
echo "---------------" >> map.log

for ((i=0; i<$total_files; i+=2))
sample_name=`echo ${arr[$i]} | awk -F "_" '{print $1}'`
echo "[mapping running for] $sample_name"
printf "\n"
echo "bwa mem -t 12 A1_denovo_assembly.fasta ${arr[$i]} ${arr[$i+1]} > $sample_name.sam" >> map.log
bwa mem -t 12 A1_denovo_assembly.fasta ${arr[$i]} ${arr[$i+1]} > $sample_name.sam
ADD COMMENTlink modified 11 months ago • written 11 months ago by MSM5590

Some elegant bash / awk here. +1

ADD REPLYlink written 10 days ago by ThePresident100
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 797 users visited in the last hour