Questions tagged [grep]
The grep tag has no usage guidance.
How to remove empty files from a directory?
I have a directory of FASTA files, some of which are empty (placeholders that were output from a pipeline) and I would like to delete the empty files using a for loop on the command line. From what I ...
Grep peculiar pattern inside a file
I would like to grep everything inside the second square bracket of a file: ...
Removing particular line along with Fasta header in fasta file
I have a fasta file of 3'UTR sequences of the genes. Some of the gene do not have a 3'UTR sequence and reported with sequence unavailable but there is FASTA header. ...
Elegant Way to Extract Gene Symbols from FASTA Headers
I've downloaded the RefSeq transcript sequences (FASTA format) for the GRC38 patch 14 build of the human genome and would now like to extract the gene symbols (only) in order from the headers. I'm ...
How to copy only certain counts for genes in tsv file to new file in linux
Hi there I have generated a counts table of samples I need to compare by differential expression analysis. The layout of the counts table is as follows: Gene_id Sample_A_r1 Sample_A_r2 Sample_B_r1 ...
Using grep to get lines from a file (.tsv) that contain specific samples listed in a sample file (.tsv)
So I have a file, let's call it pcawg.tsv. It's formatted like the one down below. ...
Finding smaller sequences from within larger sequences
I am currently working with fastq files which have hundreds of thousands of lines of text. However, not all of them are sequences I am interested in. My sequences are in one line and have a fixed ...
Telling grep to treat N as [ATCG]
Okay so I'm using grep to try and get a preview of some trimming operations that are not going as expected.. Lets say that my sequence in the FastQ file is: ATNGCNATCG What I want to do is.. ...
How to grep with a list of genes from a gff the GO terms
I have a text file with a list of name of genes (alias names) like this (** added for emphasis): ...
How to get matching pattern along with ID in a single command in grep?
I have a file containing multiple fast sequneces. For a specific consensus pattern as input, I extracted all the matching patterns from target fasta sequences with ...
FASTQ file reads extraction paired ends
I have paired end reads and want to extract only those which have this sequence within them: TGTATGTAAACTTCCGACTTCAACTGTA I tried using ...
How to replace sequence identifiers in a fasta with OTU IDs from another file?
I'm pretty new to Unix and bioinformatics and having a hard time accomplishing the following. I have one FASTA file with sequences and headers, and one OTU ID mapping file (.txt) with OTU IDs and ...
How do I Read a Sam File into a String Using ifstream in C++?
I am trying to read a .sam file into a single string in C++. My end goal is to read this string into a vector, where tabs indicate separations between elements of the vector. After making a vector ...
Extract sequences from partial Header
I have a library I would like to split them based on their headers. Some are related to RNA and DNA. The header contains much information, but the most important the presence of DNA or RNA/LTR.., ...