Help required in making a script work for NGS data analysis pipeline
2
0
Entering edit mode
8.9 years ago

How to make work the following script? I got this code from some tutorial and I have no idea how to make it work? Is it a perl script or python? how to execute it. Kindly help me out in this regard . Thanks

$ for left_fq in /data/reads/NA19240/*_1.fq; do
$ right_fq=${left_fq/_1.fq/_2.fq}
$ lane_id=$(basename ${left_fq/_1.fq})
$ rtg format -f fastq -q sanger -o ${lane_id} -l ${left_fq} -r $
{right_fq} --sam-rg "@RG\tID:${lane_id}\tSM:NA19240\tPL:ILLUMINA"
$ done
ngs code • 2.8k views
ADD COMMENT
0
Entering edit mode

it looks like shell script / bash

ADD REPLY
0
Entering edit mode

Hmm . Can you kindly elaborate a little more? like how can i make this script work? pasting in notepad? .bat extension?

ADD REPLY
0
Entering edit mode

"Is there a way to run Bash scripts on Windows?" http://stackoverflow.com/questions/6413377

ADD REPLY
0
Entering edit mode

Oh, I did not notice you may use windows. That would be very complicated I think.

ADD REPLY
0
Entering edit mode
8.9 years ago
Roden Luo ▴ 40

Hi Adnan,

As Pierre says, it is bash script.

To fully understand it, you should first get some insights of linux bash commands, such ls, cd. Supposing you are following a tutorial, you should have some .fq files at /data/reads/NA19240/. They should name as *_1.fq and *_2.fq. And you should have a software called rtg, which may mentioned in the tutorial.

Then you should be able to run it.

To run, either type the whole following code in command line:

for left_fq in /data/reads/NA19240/*_1.fq; do right_fq=${left_fq/_1.fq/_2.fq}; lane_id=$(basename ${left_fq/_1.fq}); rtg format -f fastq -q sanger -o ${lane_id} -l ${left_fq} -r ${right_fq} --sam-rg "@RG\tID:${lane_id}\tSM:NA19240\tPL:ILLUMINA"; done

or: type for left_fq in /data/reads/NA19240/*_1.fq; do then press "Enter" or "Return" on your keyboard. And do the same for the following lines. IGNORE the $ signs at the start of each line. It is just the sign indicating that you should run the rest part in your command line.

Hope this can help you.

ADD COMMENT
0
Entering edit mode

Sorry. This reply presumes that you can try this on a Linux or Unix machine. And if you are going to use some other bioinformatics tools. I highly suggest that you use Linux to follow those tutorials. You can try Ubuntu, it is a free system.

ADD REPLY
0
Entering edit mode
8.9 years ago
Or Cygwin in Windows..
ADD COMMENT

Login before adding your answer.

Traffic: 2784 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