Breaking a fasta formatted file into multiple files containing each gene separately
Hey,
I've been trying to break a massive fasta formatted file into files containing each gene separately. Could anyone help me? I've tried to use the following code but i've recieved errors every time:
Last edited by Corona688; 03-16-2012 at 12:47 PM..
You cannot use shell variables inside awk in that manner, which causes malfunctions. $i for instance would be, if i=1, field one, not a shell variable. You don't need the shell variable in the first place fortunately, awk can handle multiple files by itself.
This will create files 0001.out, 0002.out, etc, etc.
The name of the file currently being processed is available as the special varaible FILENAME, if you want to base the output filename on it.
I have two fasta files as shown below,
File:1
>Contig_1:90600-91187
AAGGCCATCAAGGACGTGGATGAGGTCGTCAAGGGCAAGGAACAGGAATTGATGACGGTC
>Contig_98:35323-35886
GACGAAGCGCTCGCCAAGGCCGAAGAAGAAGGCCTGGATCTGGTCGAAATCCAGCCGCAG
>Contig_24:26615-28387... (11 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 the following data set about the snps ID txt file
POS ID
78599583 rs987435
33395779 rs345783
189807684 rs955894
33907909 rs6088791
75664046 rs11180435
218890658 rs17571465
127630276 rs17011450
90919465 rs6919430
and a gene... (7 Replies)
Dear all,
I have huge txt file with the input files for some setup_code. However for running my setup_code, I require txt files with maximum of 1000 input files
Please help me in suggesting way to break down this big txt file to small txt file of 1000 entries only.
thanks and Greetings,
Emily (12 Replies)
Hello,
I have 10 fasta files with sequenced reads information with read sizes from 15 - 35 . I have combined the reads and collapsed in to unique reads and filtered for sizes 18 - 26 bp long unique reads. Now i wanted to count each unique read appearance in all the fasta files and make a table... (5 Replies)
I've been trying to write a command-line function to grab a website's MX records and their ip addresses. The code below works with domains that only have one MX record:
function kmx { mx=`host -t MX $1 | awk '{ print $7 }'`;
ip=`host $mx | sed '/IPv6/d;/handled/d' | awk '{ print $4 }'`; ... (8 Replies)
Hello Friends,
I am trying to implement the following using UNIX. I am getting a sequential file as input which would have two columns, "Name" and "Countries Visited". The "Countries Visisted" field will be multi-valued, each value separated by a space and also the number of values are not... (2 Replies)
Hi.,
My current script extracts only if the date and time are in 3rd and 4th pos.
#!/bin/bash
echo "Enter the file name to extract the timestamp"
read fname
IFILE=$fname
F=$IFILE
IFS="_."
f=($F)
echo "Date ${f} Time ${f}"
How to generalize the script to extract the... (3 Replies)
Hi,
I have a code as given below
Set -A _Category="A\
B\
C"
for _cat in ${_Category}
do
sed -e "s:<TABLE_NAME>:${_cat}:g" \
-e "s:<date>:${_dt}:g" \
${_home}/skl/sq1.sql >> ${_dest}/del_${_dt}.sql
fi
... (4 Replies)
Hi,
I have a file that looks like this (tab deliminited).
MAT1 YKR2 3
MAT1 YMR1 2
MAT1 YFG2 2
MAT2 YLM4 4
MAT2 YHL2 1
BAR1 YKR2 3
BAR1 YFR1 4
BAR1 YMR1 1
What I want to do is break this file down into multiple files. So the result will look like this:
File 1... (2 Replies)