Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Select distinct sequences from fasta file and list Post 302918635 by Marion MPI on Wednesday 24th of September 2014 01:44:05 PM
Old 09-24-2014
Select distinct sequences from fasta file and list

Hi
How can I extract sequences from a fasta file with respect a certain criteria? The beginning of my file (containing in total more than 1000 sequences) looks like this:
Code:
>H8V34IS02I59VP 
SDACNDLTIALLQIAREVRVCNPTFSFRWHPQVKDEVMRECFDCIRQGLG
YPSMRNDPILIANCMNWHGHPLEEARQWVHQACMSPCPSTKHGFQPFRMA
SATANCAKIIEYALSNGYDPVVNMQMGPKIGDARDFT*L*TVIRGLGTTR
WSG
>H8V34IS02IRUQO 
SDACNDLTTAYMQAARLVRVCNPTFSFRYHPQVKDEVMREAFGCIRHGLG
YPNIKNDSVLIPNAMYWHGHPLEEARQWVNQACMSPCPPXKYGCQPNRMA
SAANCAKMIEYTLHTGMIM**TCRVGTEGRVIRAYFKDFGGVLTRYGVKQ
MEWLDVVLIVRFT
>H8V34IS02HTVT3 
SDACNGMTIALMQAARLVRTPNPTFAFRWHPKVKDEVMREIFECIRHGLG
YPAMRNDPILISNAMHWHRHPIEEARTWVHQACMSPCPTTKHGTQPMRMA
HATANCAKIMEYALWNGYDHVVNMQMGPRTGDARKFTDFEQLFDAWVKQX
DGC
>H8V34IS02HI4PS 
SDACNALTDCYLEAALVSRVSDPTFGFRYHSKVRTETLRRVFECIRHGLG
YPSIRNDDVLIPNIMHWFGHPLKEARRWLHQACMAPAPDTKWGAPSLRYP
QASIITGSKAISLAMFDGFDPLTGMQTGIKTGDCSKFETFDEFYDAWYEQ
PKAGFKQATGMEH
>H8V34IS02F9NL0 
SDACNDLTIALLQIAREVRVCNPTFSFRWHPQVKDEVMRECFDCIRQGLG
YPSMRNDPILIANCMNWHGHPLEEARQWVHQACMSPCPSTKHGFQPFRMA
SATANCAKIIEYALSNGYDPVVNMQMGPKIGDAGISDFEQLFEAWVQTDG
VA*WIL

I want to extract the sequences containing the motif FDCIR? Can it be done with grep? Or do I need a pearl script?
In a next step: How could I even extract sequences with respect to fullfilling two or more criteria?

Looking forward getting your suggestions.

Cheers, Marion.

Last edited by jim mcnamara; 09-24-2014 at 04:55 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

select distinct row from a file

Hi, buddies out there. I have a text file ( only one column ) which I created using vi editor. The file contains duplicate rows and I would like to select distinct rows, how to go on it using unix command: file content = apple apple orange watermelon apple orange Can it be done... (7 Replies)
Discussion started by: merry susana
7 Replies

2. Shell Programming and Scripting

Select distinct values from a flat file

Hi , I have a similar problem. Please can anyone help me with a shell script or a perl. I have a flat file like this fruit country apple germany apple india banana pakistan banana saudi mango india I want to get a output like fruit country apple ... (7 Replies)
Discussion started by: smalya
7 Replies

3. Shell Programming and Scripting

Select distinct rows in a file by last column

Hi, I have the following file: LOG:015608::ERR:2310:map_spsrec:Invalid parameter LOG:015608::ERR:2471:map_dgdrec:Invalid parameter LOG:015608::ERR:2487:map_nnmrec:Invalid number LOG:015608::ERR:2310:map_nmrec:Invalid number LOG:015608::ERR:2438:map_nmrec:Invalid number As a delimiter I... (2 Replies)
Discussion started by: apenkov
2 Replies

4. Shell Programming and Scripting

Shell script for changing the accession number of DNA sequences in a FASTA file

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)
Discussion started by: margarita
5 Replies

5. Shell Programming and Scripting

Extract sequences from a FASTA file based on another file

I have two files. File1 is shown below. >153L:B|PDBID|CHAIN|SEQUENCE RTDCYGNVNRIDTTGASCKTAKPEGLSYCGVSASKKIAERDLQAMDRYKTIIKKVGEKLCVEPAVIAGIISRESHAGKVL KNGWGDRGNGFGLMQVDKRSHKPQGTWNGEVHITQGTTILINFIKTIQKKFPSWTKDQQLKGGISAYNAGAGNVRSYARM DIGTTHDDYANDVVARAQYYKQHGY >16VP:A|PDBID|CHAIN|SEQUENCE... (7 Replies)
Discussion started by: nelsonfrans
7 Replies

6. Shell Programming and Scripting

Shorten header of protein sequences in fasta file

I have a fasta file as follows >sp|O15090|FABP4_HUMAN Fatty acid-binding protein, adipocyte OS=Homo sapiens GN=FABP4 PE=1 SV=3 MCDAFVGTWKLVSSENFDDYMKEVGVGFATRKVAGMAKPNMIISVNGDVITIKSESTFKN TEISFILGQEFDEVTADDRKVKSTITLDGGVLVHVQKWDGKSTTIKRKREDDKLVVECVM KGVTSTRVYERA >sp|L18484|AP2A2_RAT AP-2... (3 Replies)
Discussion started by: alexypaul
3 Replies

7. Shell Programming and Scripting

Getting unique sequences from multiple fasta file

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)
Discussion started by: Ibk
3 Replies

8. UNIX for Beginners Questions & Answers

How to count the length of fasta sequences?

I could calculate the length of entire fasta sequences by following command, awk '/^>/{if (l!="") print l; print; l=0; next}{l+=length($0)}END{print l}' unique.fasta But, I need to calculate the length of a particular fasta sequence specified/listed in another txt file. The results to to be... (14 Replies)
Discussion started by: dineshkumarsrk
14 Replies

9. Shell Programming and Scripting

Shorten header of protein sequences in fasta file to only organism name

I have a fasta file as follows >sp|Q8WWQ8|STAB2_HUMAN Stabilin-2 OS=Homo sapiens OX=9606 GN=STAB2 PE=1 SV=3 MMLQHLVIFCLGLVVQNFCSPAETTGQARRCDRKSLLTIRTECRSCALNLGVKCPDGYTM ITSGSVGVRDCRYTFEVRTYSLSLPGCRHICRKDYLQPRCCPGRWGPDCIECPGGAGSPC NGRGSCAEGMEGNGTCSCQEGFGGTACETCADDNLFGPSCSSVCNCVHGVCNSGLDGDGT... (3 Replies)
Discussion started by: jerrild
3 Replies

10. UNIX for Beginners Questions & Answers

How to add specific bases at the beginning and ending of all the fasta sequences?

Hi, I have to add 7 bases of specific nucleotide at the beginning and ending of all the fasta sequences of a file. For example, I have a multi fasta file namely test.fasta as given below test.fasta >TalAA18_Xoo_CIAT_NZ_CP033194.1:_2936369-2939570:+1... (1 Reply)
Discussion started by: dineshkumarsrk
1 Replies
RAS(9)							   BSD Kernel Developer's Manual						    RAS(9)

NAME
ras_lookup, ras_fork, ras_purgeall -- restartable atomic sequences SYNOPSIS
#include <sys/types.h> #include <sys/proc.h> #include <sys/ras.h> void * ras_lookup(struct proc *p, void *addr); int ras_fork(struct proc *p1, struct proc *p2); int ras_purgeall(struct proc *p); DESCRIPTION
Restartable atomic sequences are user code sequences which are guaranteed to execute without preemption. This property is assured by check- ing the set of restartable atomic sequences registered for a process during cpu_switchto(9). If a process is found to have been preempted during a restartable sequence, then its execution is rolled-back to the start of the sequence by resetting its program counter saved in its process control block (PCB). The RAS functionality is provided by a combination of the machine-independent routines discussed in this page and a machine-dependent compo- nent in cpu_switchto(9). A port which supports restartable atomic sequences will define __HAVE_RAS in <machine/types.h> for machine-indepen- dent code to conditionally provide RAS support. A complicated side-effect of restartable atomic sequences is their interaction with the machine-dependent ptrace(2) support. Specifically, single-step traps and/or the emulation of single-stepping must carefully consider the effect on restartable atomic sequences. A general solution is to ignore these traps or disable them within restartable atomic sequences. FUNCTIONS
The functions which operate on restartable atomic sequences are: ras_lookup(p, addr) This function searches the registered restartable atomic sequences for process p which contain the user address addr. If the address addr is found within a RAS, then the restart address of the RAS is returned, otherwise -1 is returned. ras_fork(p1, p2) This function is used to copy all registered restartable atomic sequences for process p1 to process p2. It is primarily called from fork1(9) when the sequences are inherited from the parent by the child. ras_purgeall(p) This function is used to remove all registered restartable atomic sequences for process p. It is primarily used to remove all reg- istered restartable atomic sequences for a process during exec(3) and by rasctl(2). CODE REFERENCES
The RAS framework itself is implemented within the file sys/kern/kern_ras.c. Data structures and function prototypes for the framework are located in <sys/ras.h>. Machine-dependent portions are implemented within cpu_switchto(9) in the machine-dependent file sys/arch/<arch>/<arch>/locore.S. SEE ALSO
rasctl(2), cpu_switchto(9), fork1(9) Gregory McGarry, "An Implementation of User-level Restartable Atomic Sequences on the NetBSD Operating System", Proceedings of the FREENIX Track: 2003 USENIX Annual Technical Conference, USENIX Association, http://www.usenix.org/publications/library/proceedings/usenix03/tech/freenix03/full_papers/mcgarry/mcgarry.pdf, 311-322, June 9-14, 2003. HISTORY
The RAS functionality first appeared in NetBSD 2.0. BSD
April 17, 2010 BSD
All times are GMT -4. The time now is 01:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy