Question: Save .sam file in a target directory
0
gravatar for Bella_p
17 months 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 • 504 views
ADD COMMENTlink written 17 months 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 17 months ago by Joe14k
3
gravatar for genomax
17 months ago by
genomax71k
United States
genomax71k wrote:
-S ${target_dir}/test1.sam
ADD COMMENTlink written 17 months ago by genomax71k

Works perfectly. Thanks a lot!

ADD REPLYlink written 17 months 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 17 months ago by WouterDeCoster40k
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: 1655 users visited in the last hour