Thanks for your comment but I want to have an output if it contain one or all of this strings “Luciferase reporter assay//qRT-PCR//Western blot” NOT just common ID
• 0 views
•
link
Hello all , Could you please help me about this? I have 2 tab delimited file, I want to compare them to find common Id between 2 file which has one or all of these report in 7 column of the second file “Luciferase reporter assay//qRT-PCR//Western blot” For instance :
1st file
hsa-miR-654-5p
hsa-miR-182-5p
2nd file
MIRT733442 hsa-miR-654-5p Homo sapiens RPS6KB1 6198 Homo sapiens PAR-CLIP
MIRT733429 hsa-miR-654-5p Homo sapiens EPSTI1 94240 Homo sapiens Luciferase reporter assay//qRT-PCR//Western blot
Out put
MIRT733429 hsa-miR-654-5p Homo sapiens EPSTI1 94240 Homo sapiens Luciferase reporter assay//qRT-PCR//Western blot
Thanks in advance
find common Id between 2 file
it's a job for comm https://linux.die.net/man/1/comm
comm -12 <(sort -t $'\t' file1.txt | sort | uniq) <(cut -f 2 file2.txt | sort -t $'\t' | sort | uniq)
Thanks for your comment but I want to have an output if it contain one or all of this strings “Luciferase reporter assay//qRT-PCR//Western blot” NOT just common ID
then it's join : follow genomax 's link.
Here the link to that thread: How to retrieve rows from OTU table
Log in to answer this question.
in bash shell with grep:
test1.txt - 1st file and test2.txt- 2nd file in OP and assuming that blot is common in all lines ending up with western blot and no other line has word blot in it.
with awk:
with join:
didn't see the second requirement in OP.
Thanks lessismore, you are a real biostars :)
In R
2nd file is a huge file and with grep -f test1.txt test2.txt > out.put , OP contain all data of test2.txt NOT common data of both files, how I can solve this problem ? for instance , out put file contain hsa-miR-99 but it's not available in test1.txt file
I already also tried with this command
but again out put file contain hsa-miR-99 !