Questions tagged [grep]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
4 votes
2 answers

Keeping DNA sequence after changing FASTA header on command line

I have a FASTA header that looks like this: ...
rimo's user avatar
  • 923
1 vote
4 answers

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 ...
rimo's user avatar
  • 923
1 vote
4 answers

Grep peculiar pattern inside a file

I would like to grep everything inside the second square bracket of a file: ...
Marco's user avatar
  • 161
1 vote
4 answers

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. ...
Dr Sud's user avatar
  • 19
2 votes
2 answers

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 ...
Mark Pauley's user avatar
3 votes
3 answers

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 ...
Justin1609's user avatar
0 votes
2 answers

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. ...
Michelle Yang's user avatar
1 vote
3 answers

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 ...
Jean Luc's user avatar
4 votes
1 answer

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.. ...
RPINerd's user avatar
  • 51
0 votes
1 answer

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): ...
Jim Hat's user avatar
  • 11
1 vote
1 answer

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 ...
20 21's user avatar
  • 13
1 vote
2 answers

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 ...
Amit's user avatar
  • 133
1 vote
2 answers

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 ...
ecprimate's user avatar
1 vote
0 answers

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 ...
annabelperry's user avatar
0 votes
2 answers

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.., ...
BioInfo's user avatar
  • 374