Great, that works perfectly. Excuse me but I'm a begginer and trying to write a pipeline for ChipSeq using Bowtie2. I'm trying to convert fastq file into sorted bam file, without duplicates. I wrote the following command:
${bowtie2_source} -x ${indexed_hg18} -U ${fastq_file} -S | ${samtools} view -bS | ${samtools} sort | ${samtools} rmdup -S ${target_dir}/${sample_name}.bam
Is it Ok in your opinion? or do I need to add at the end also -o ?
If an answer was helpful you should upvote it, if the answer resolved your question you should mark it as accepted. Please do the same for your previous posts as well.
Pierre has the right answer. The way you have written it, the software thinks that you want to look at all entries in the bam that have the chromosome name ${target_dir}/${sample_name}. This can't be done unless the sam/bam has an index, so the software is complaining.