Entering edit mode
7.3 years ago
jaqx008
▴
110
Hey all. I am doing a differential expression analysis and trying to use grep to find genes that are up-regulated and also those that are down-regulated by comparing the genes ortholog of different species of a bacteria to the Deseq2 result of each species. However, I think something is wrong with my grep command and I am getting an error. I would appreciate any help or explanation.
the command I am using to find the up-regulated gene (in terminal) is
grep -f up./Users/flynt/Desktop/Deseq2/3084DEortho.txt geneortholg./Users/flynt/Desktop/Deseq2/30_84_vs_all.txt > 3084DE.txt
I am a beginner in this field. Thanks in advance
Adding to what genomax said: if you're finding a list of genes using
grep
, it is always good idea to add-F
where it evaluates the search terms as fixed strings and-w
for whole word, so you don't bring up 10, 100, 1000 when searched with 10.Thanks Arnstrm. your suggestion was helpful. Thanks again
When you are specifying full directory paths such as
/Users/flynt/Desktop/Deseq2/3084DEortho.txt
there is no reason to add.
at the beginning. I assumeup
is a a file containing the genes that are up-regulated? Try:Thanks Max. I tried the command and got same error
That means you don't have a file called
up
in the directory you are running this from. If that file is in some other directory then provide full path forup
file in your command. Also consider adding additional options suggested by @arnstrm below.Ok. I think the "up" is just part of the command to help grep find up-regulated genes in the ortholog? I don't have an actual file called 'up'.
If you take a look at the help for
grep
you will see that-f
option expects a filename. That file will contain pattern(s) (one per line, say a gene name) that it will use to search. You can't do any quantitative searching withgrep
. You will need to usesort
to sort your file by columns (if you have values in columns) to get genes that may be over-expressed (based on ratios/fold-change what ever it is that you have in the file) to get them to the top or bottom of the file.Ok. My file has a sorted (based on 2foldchange) list of gene id's. so I now used this command
grep -f /Users/flynt/Desktop/Deseq2/3084DEortho.txt /Users/flynt/Desktop/Deseq2/30_84_vs_all.txt > file.txt
and got an out put .txt file.
The idea was to include up to generate up-regulated and repeat the command with down, to get down regulated I guess. But I am thinking this is wrong.
I can't tell if the text file generated form the above command is up or down since I didn't specify in the command.
Thanks Max. I figured I didn't understand the instruction . The command works fine now. Thanks again