Mapping with tophat2 and setting a Tophat2 output directory?
3
2
Entering edit mode
8.5 years ago
mirza ▴ 180

Hello, I have successfully installed tophat2 with bowtie2 and samtools and have created my bowtie2 indices. I have paired end reads for several different conditions. My questions: 1. Is it possible to run these different sets in separate terminals simultaneously?

  1. The default output directory is tophat_out. How can I determine a separate output directory for each data set? I tried using the -o/ or --output-dir command given in the tophat manual but its not working.

  2. As I am new to tophat, What is the best approach for mapping, the above method or giving all different sets in a single command line (wouldn't the output be confusing)?

RNA-Seq tophat • 5.8k views
ADD COMMENT
0
Entering edit mode

Please post the error you're getting with -o/--output-dir

ADD REPLY
0
Entering edit mode

It would be easier to understand your problem if you give an example command you entered.

For 2) do you want to map the different conditions together in a single file? I assume not?

ADD REPLY
4
Entering edit mode
8.5 years ago
pld 5.1k

It looks like you're not putting the arguments in the correct order.

From the Tophat manual:

Usage: tophat [options]* <genome_index_base> <reads1_1[,...,readsN_1]> [reads1_2,...readsN_2]

What you're doing:

tophat <genome_index_base> <reads> [options]*

The flag -o is an option, so it needs to go before you list the genome index and reads. Once tophat gets the genome index and reads, it assumes there's no more information and ignores any remaining input.

Here's your fixed command:

tophat -o Rs_Os2_3day rice_indica Fungal_Rice_Variety2_3day_R1.fastq.gz Fungal_Rice_Variety2_3day_R2.fastq.gz

Note, the position of the output directory option has been moved.

In the future, remember that anytime you see documentation on usage you'll want to be sure to pay attention to the order.

ADD COMMENT
0
Entering edit mode
8.5 years ago

1. Is it possible to run these different sets in separate terminals simultaneously?

I guess it is possible, however it might not be faster depending on your computer.

How can I determine a separate output directory for each data set?

-o should work. Would you mind showing your code ?

What is the best approach for mapping, the above method or giving all different sets in a single command line (wouldn't the output be confusing)?

I suggest to proceed with 1 alignment -> 1 tophat command. If you want to automate the process, you can always write a shell script.

ADD COMMENT
0
Entering edit mode

@Carlo.Ankou If one wants to map the reads to exact position from where it originated in genome, how could one achieve that. I am confused with the options -M,-x and -g parameters. Kindly guide me

ADD REPLY
0
Entering edit mode

Then I think you should ask a separate question.

ADD REPLY
0
Entering edit mode

can you suggest sources to get some help with this script writing particularly?

ADD REPLY
1
Entering edit mode
ADD REPLY
0
Entering edit mode

Writing shell scripts is easy if you know just the basic syntax. I learned from this article many skills:Writing shell scripts

ADD REPLY
0
Entering edit mode
8.5 years ago
mirza ▴ 180

@carlo

  1. I am using a dell tower workstation (265gb ram), so I think there shouldn't be any memory issues.

  2. I used all the following command lines, but I can't see any directory being made-

    $ tophat rice_indica Fungal_Rice_Variety2_3day_R1.fastq.gz Fungal_Rice_Variety2_3day_R2.fastq.gz -o Rs_Os2_3day

    $ tophat rice_indica Fungal_Rice_Variety2_3day_R1.fastq.gz Fungal_Rice_Variety2_3day_R2.fastq.gz -o/ Rs_Os2_3day

    $ tophat rice_indica Fungal_Rice_Variety2_3day_R1.fastq.gz Fungal_Rice_Variety2_3day_R2.fastq.gz --output-dir Rs_Os2_3day

ADD COMMENT
1
Entering edit mode

Is the program actually running? Do you have write permissions on the local directory (since you are directing -o to current directory)?
Don't use the "Submit Answer" dialog box to provide additional information/respond to previous posts/comments. Use the ADD REPLY/ADD COMMENT boxes against the posts you are responding to for that purpose.

ADD REPLY
0
Entering edit mode

I apologize for the mistake.

ADD REPLY
0
Entering edit mode

Is there an error ? What is written on your terminal after one of those command ? are all the required files in your current directory ?

ADD REPLY
0
Entering edit mode

the second has -o/ with the slash being an error: -o Rs_Os2_3day third: For double dash flags you usually need an equality sign: --output-dir=Rs_Os2_3day

ADD REPLY
0
Entering edit mode

@Aerval Thanks for your reply. @carlos I am a new user so I could post limited comments yesterday. All files are in the current directory. Tophat is running successfully both with and without -o I completed a run yesterday without -o in the command line. Today I have started another run with -o , the program seems to be running but still can't see the output directory. I am copying the messages on the terminal for a -o command line

gopaljee@ubuntu:~/Softwares/bowtie2-2.2.9/example/index$ tophat rice_indica Fungal_Rice_Variety2_3day_R1.fastq.gz Fungal_Rice_Variety2_3day_R2.fastq.gz -o v2_3d_out

[2016-05-10 10:13:31] Beginning TopHat run (v2.0.9)
-----------------------------------------------
[2016-05-10 10:13:31] Checking for Bowtie
          Bowtie version:    2.1.0.0
[2016-05-10 10:13:31] Checking for Samtools
        Samtools version:    0.1.19.0
[2016-05-10 10:13:31] Checking for Bowtie index files (genome)..
[2016-05-10 10:13:31] Checking for reference FASTA file
[2016-05-10 10:13:31] Generating SAM header for rice_indica
    format:      fastq
    quality scale:   phred33 (default)
[2016-05-10 10:13:32] Preparing reads
        left reads: min. length=100, max. length=100, 21763247 kept reads (12185 discarded)
    right reads: min. length=100, max. length=100, 21727897 kept reads (47535 discarded)
[2016-05-10 10:28:43] Mapping left_kept_reads to genome rice_indica with Bowtie2
ADD REPLY
0
Entering edit mode

tophat seems to work properly... that's weird. Four things you could try :

1 - type ls -lAh in the terminal and make sure that the folder v2_3d_out doesn't exist.

2 - try using absolute path to specify the folder, such as ~/Softwares/bowtie2-2.2.9/example/index/v2_3d_out

3 - try using sudo when calling tophat sudo tophat rice_indica Fungal_Rice_Variety2_3day_R1.fastq.gz Fungal_Rice_Variety2_3day_R2.fastq.gz -o v2_3d_out

4 - What if you create the directory by yourself before calling tophat ?

Let me know if one of these works.

ADD REPLY
1
Entering edit mode

Option #3 is atomic. That should never be needed to run a user level program. Edit: TopHat will re-use a directory if it exists.

ADD REPLY
0
Entering edit mode

@carlo used the 2rd and 4th option, didn't work...its really weird. don't understand the 1st option, so didn't try. Didn't try the 3rd option due to genomax2's comment.

ADD REPLY
0
Entering edit mode

moved all the files to a new index directory, still no option works. It created a new tophat_out directory itself by default.

ADD REPLY

Login before adding your answer.

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