@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
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?
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.
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)?
3 answers
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.
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.
Then I think you should ask a separate question.
can you suggest sources to get some help with this script writing particularly?
about shell scripts : http://linuxcommand.org/lc3_writing_shell_scripts.php
a related question : bash loop for alignment RNA-seq data
Writing shell scripts is easy if you know just the basic syntax. I learned from this article many skills:Writing shell scripts
@carlo
I am using a dell tower workstation (265gb ram), so I think there shouldn't be any memory issues.
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
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.
I apologize for the mistake.
Is there an error ? What is written on your terminal after one of those command ? are all the required files in your current directory ?
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
@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
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.
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.
@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.
moved all the files to a new index directory, still no option works. It created a new tophat_out directory itself by default.
Log in to answer this question.
Please post the error you're getting with -o/--output-dir
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?