ok thank you
Hi everyone,
What I need to do is I need multiple sequence alignment file
I converted the vcf file to consensus fasta and cat all these consensus sequence into multifasta.
In my cat file seq are >1......>10000 for a.fasta and >1......>10000 for b.fasta when I use clustalw it gives error that sequence have same header THAT MAKES SENSE so what I am planning to do is to convert >1......>10000 to >1 and >1......>10000 for b.fasta to >2 and same for for all my 5 samples
Guide me with command to do that
Please do suggest any help
Regards
1 answer
It's because there are no \n at the end of the sequences. In your combined fasta >B_1 is next to the last nucleotide of >A_1 sequence, i.e. there's only one line that begins with > (grep -c "^>"), grep -c ">" would return 2. To avoid this you can for example awk '{print}' a.fasta b.fasta > combined.fasta. Also, it is generally a good idea to use > instead of >> because >> appends.
Edit. meant to post as a comment
Thank you it (awk '{print}' a.fasta b.fasta >combined.fasta) was good.
Can I ask you one question not related to this
I have to count number of bases in fasta file and using this command
grep -v ">" a.fasta | wc | awk '{print$3-$1}'
I know this command is correct as it gives me same result on galaxy
can you explain what $3-$1 means
I saw on awk manual that $ is for column and - for subtraction but in fasta file we don't have columns so how to understand
Log in to answer this question.
So
a.fastacontains 10000 sequences with headers 1, 2, 3, .... 10000 andb.fastacontains 10000 sequences with headers 1, 2, 3, .... 10000? You have 5 fasta files like that (a, b, c, d, e) and you want to combine them to a single file keeping their identity, right? It is easy, just change the header in each file and combine them using cat:(If you want to use numbers instead of letters, substitute letters with numbers in the above
sedcommands)Thank you let me try and see whether it answers my problem
Can you suggest me how I can combine
a.fastawith 10000 sequences having headers 1, 2, 3, .... 10000 .......................into just one header e.gPlease suggest
Concatenate
1. the first line of
a.fastaand
2. all the lines of
a.fastathat don't have a ">" with line-breaks deletedThanks let me try this
I understand first part but what does this mean
to remove the new line character
Thank you
I did as directed now I have file with one header e.g
I did this with two files
Now I want to combine them when I did I get
When I want to check both come in one file or not I did
It gives 1. My question is why not 2?
And when I upload this multifasta file on galaxy for multiple alignment it gives badly formatted file error
Please help