Go Back   SEQanswers > General

Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it possible to create a consensus sequence from a fasta file? ssnowfox Pacific Biosciences 4 06-23-2016 08:21 PM
Is it possible to create a consensus sequence from a fasta file? ssnowfox Bioinformatics 1 02-12-2015 01:01 PM
adapters sequence fasta file mmmm Bioinformatics 14 12-12-2013 11:39 PM
How to combine all the seqences in a fasta file to one sequence? wmseq Bioinformatics 7 10-28-2013 09:40 AM
FASTA sequence From large BAM file mez Bioinformatics 9 01-13-2013 06:42 AM

Thread Tools
Old 11-20-2015, 04:16 AM   #1
Junior Member
Location: spain

Join Date: Nov 2015
Posts: 1
Post how to get the ID of the sequence matched from a fasta file

Hi Everyone!
I am a begginer in Bioinformatics and I need to solve the following problem:
I have a fasta file of protein that looks like this:

I have to match a sequence, for example, AIKA in each sequence and then return the corresponding ids of matches.
Thanks a lot
nmauri is offline   Reply With Quote
Old 11-20-2015, 06:28 AM   #2
Senior Member
Location: Cambridge, UK

Join Date: May 2010
Posts: 311

This has been asked before in different flavours. If you are ok using shell/bash, try this:

awk -v RS=">" 'NR>1 {sub("\n", "\t"); gsub("\n", ""); print ">"$0}' test.fa \
| awk -v FS="\t" '$2 ~ /AIKA/ {sub("\t", "\n"); print $0}'
First awk linearizes the fasta file, second awk captures records containing AIKA and outputs back in fasta format. The original line wrapping is lost though.
dariober is offline   Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT -8. The time now is 11:15 PM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO