This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Save .sam file in a target directory

Hi,

I'm a beginner and starting to write my first Chip-Seq analysis. I'm using Bowtie2, and the first step is to turn fastq file into .sam file. I've written the following command:

${bowtie2_source} -x ${ref_genome} -U ${fastq_file} -S ${target_dir} test1.sam

I have an error in the last part of the script. I want that the .sam file output file will be save in a specific location ({target_dir}) with a specific name (test1). How to fix the script?

chip-seq bowite2 bash

A general comment: it's good practice to soft-quote all your variables when you call them (i.e. ${fastq_file} -> "${fastq_file}") as this will sometimes catch unexpected expansions of variable names, if they had whitespace or slashes in for example, which could trick your script in to thinking they're separate arguments, rather than one arg with spaces in.

1 answer

-S ${target_dir}/test1.sam

Works perfectly. Thanks a lot!

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.

Upvote|Bookmark|Accept

Log in to answer this question.