Question: Save .sam file in a target directory
0
gravatar for Bella_p
2.5 years ago by
Bella_p50
Bella_p50 wrote:

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?

bash bowite2 chip-seq • 788 views
ADD COMMENTlink written 2.5 years ago by Bella_p50
1

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.

ADD REPLYlink written 2.5 years ago by Joe17k
3
gravatar for genomax
2.5 years ago by
genomax89k
United States
genomax89k wrote:
-S ${target_dir}/test1.sam
ADD COMMENTlink written 2.5 years ago by genomax89k

Works perfectly. Thanks a lot!

ADD REPLYlink written 2.5 years ago by Bella_p50

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

ADD REPLYlink written 2.5 years ago by WouterDeCoster44k
Please log in to add an answer.

Help
Access

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