Save .sam file in a target directory
1
0
Entering edit mode
6.7 years ago
Bella_p ▴ 70

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 • 1.8k views
ADD COMMENT
1
Entering edit mode

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 REPLY
3
Entering edit mode
6.7 years ago
GenoMax 147k
-S ${target_dir}/test1.sam
ADD COMMENT
0
Entering edit mode

Works perfectly. Thanks a lot!

ADD REPLY
0
Entering edit mode

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 REPLY

Login before adding your answer.

Traffic: 1641 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6