trying to grep -v multiple changing sequences from a file
Hello All - I am looking for help on how to solve a re-occuring problem. I have a file with certain sequences in it that need to be removed. The sequences are always different but the fix is always the same remove those sequences and leave the rest. Another team ID's the bad sequences and then I have to remove them. I was using the following command,however, now that I am getting lists of 60 + sequences to remove it doesn't seem like the best way anymore:
I was trying to write something where I could run the same command or script on the new lists each day but I can't figure it out as my knowledge is limited at best.
You might already have your answer, but for my own curosity I'm just trying to understand it as well.
Input: File
Output = Input - lines that contain the specified sequences.
Sequences: You can have any number of sequences each time and each sequence can be of any length?
sequence1 - 1234
sequence2 - 5678
sequence3 - AAAA
Your current code is: n= the number of sequences.
So, he would take the sequences that he's given, put them in a file, then run:
And to output to a new file just add > newfile at the end of the above grep code? Or would it be | cat >> newfile?
I'm not sure what the above code is that isn't the "$grep -f list -v text" line. What topic is that if I wanted to understand it?
I'm not sure what the above code is that isn't the "$grep -f list -v text" line. What topic is that if I wanted to understand it?
this code is only and example for using "-f" option whith grep, to make te example i generate one file call list and other call text.
The file list is only a file of patterns and file text is where we want to apply the patterns.
You solution is the same solution that i'm propose.See the code:
I wish to grep for an entry in a file if it contains and does not start with #, Listen 443 or Listen 9443
Below is what helped me get Listen 443 but how can I tweak the below command to also include Listen 9443 port ?
Note: Listen 8443 or Listen 4438 should fail in the grep.
... (2 Replies)
Hi,
I have a fasta file with multiple sequences. How can i get only unique sequences from the file.
For example
my_file.fasta
>seq1
TCTCAAAGAAAGCTGTGCTGCATACTGTACAAAACTTTGTCTGGAGAGATGGAGAATCTCATTGACTTTACAGGTGTGGACGGTCTTCAGAGATGGCTCAAGCTAACATTCCCTGACACACCTATAGGGAAAGAGCTAAC
>seq2... (3 Replies)
I have a script that will search for a keyword in all the log files. It work just fine.
LOG_FILES={ "/Sandbox/logs/*" }
for file in ${LOG_FILES}; do
grep $1 $file
done
This only works for 1 keyword. What if I want to search for more then 1 keywords, say 4 or maybe even... (10 Replies)
Hi,
I am having a file of dna sequences in fasta format which look like this:
>admin_1_45
atatagcaga
>admin_1_46
atatagcagaatatatat
with many such thousands of sequences in a single file. I want to the replace the accession Id "admin_1_45" similarly in following sequences to... (5 Replies)
Hi,
I want to grep multiple patterns from multiple files and save to multiple outputs. As of now its outputting all to the same file when I use this command.
Input : 108 files to check for 390 patterns to check for. output I need to 108 files with the searched patterns.
Xargs -I {} grep... (3 Replies)
Hi,
I have a file containing list of strings like
i:
Pink
Yellow
Green
and I have file having list of file names in a directory
j :
a
b
c
d
Where j contains of a ,b,c,d are as follows
a:
Pink (3 Replies)
I want to search files (basically .cc files) in /xx folder and subfolders.
Those files (*.cc files) must contain #include "header.h" AND x() function.
I am writing it another way to make it clear,
I wanna list of *.cc files that have 'header.h' & 'x()'. They must have two strings, header.h... (2 Replies)
Hello,
I have a grep command as follows:
grep Found original_2010.01.26 | cut -f 5 -d ' '
However the file name changes each day and gets appended with today's date. For ex:
on January 27th it would be
original_2010.01.27 ... etc
The files from previous days exist on the... (3 Replies)
Being new to this area .I have been assigned a task which i am unable to do . Can any one please help me .
Hi I have requirement where i have input file XYZ_111_999_YYYYMMDD_1.TXT and with header and series of Numbers and Footer.
I want to create a mutiple output files with each file having a... (2 Replies)