I have fasta sequence and I want to write a script for "for loop" command:-
>ENST00000014935::X:154401758-154402841
TAGGTTTTTAATTACCTTTATTTTATTTTGCCAAACATACCTGGGAATACCTTTTATTTTTTTTTTACCTTGGGGTGATGGTTCCAAACCATAAATGTGATTATAGTTAACACATGACCCTTCTAGCGTCCCAGCCAGTGTTTTTCCTGACCTCTCTTCTTTGGAGAGGAGGATGGAAGGGAGGGGTCCGGCATGCTGCTGGCATTTTGCTGTGTCCTGCAGCCCCTTTCCGGGACACCTGGGTTCACACAGCTTTTTAGCTTACATAACTGGTGCAGATTTTCTGTGTGGAGATGTTGCCTTGACCAGCCTTGGCTGGACTTTACCAGGCATGCAGAAGCCTGTACCAACACAGACTACAGCACCCAGGAGGTGCGAGTGTGGCTGCTCAGCGGTTATAACAGGCCTGACTGCATTGTTCACCGGATTATAATGAGCCAAAATGTTTCCCGGTGTTTGCTGGTTTCAGGGAAGGAGTTTGATATAGCAGATTAACCACCCTCCTTGTAGCTATTGGGGCTTAATGGTTTCCTGGTGATTCTTACCAATCCACAATAAACATGGCCCATTGGCATATCTGCTGCACAAGTGTCCTATCTCACCAATCTGGGTTTTTGTTCTCAGTAACTTTCCTTCTTGTCATACAACATCTTCATTCCTCTTTCTGAACCCTCCCTTCCCCTACCCCAACCCAGAGCCCACTTTGTCTCCACTCCTGATACTACACTACCTGGCAGGTGGCATGAGTGCAGGGCCCCTGGCTTCCTCTCCTAATCTAGGCACAAGCCCAACCAAAGAACAAGAGCCAAATCAAACAAGGCAGGCAGGGGTGGACTACAGTCACAGGGCAACTATAGTTGAAGCCCCCCAGCCCCAGGGCTGGATGGACGGGGGAGGCTGGGGTTTAAGTCCCAAAAGGCAGCAGGCCCTGGGGGGGTAGGGGGACGCTCAGGCAGCAGGGCACAGCTGAGGGGACAGGAGTGATAGCAGCAACAGAACAGTGAGGCTGAGAGGCTGGACGCTGTGCGCCTGGCTCAGCTTCAGCTCCACCTCCACGGGGTAGTGGTCACTGATGTTGAGGGC
>ENST00000014935::X:154402942-154403190
TCCTCCTCGGTGAGCTGGAAGCTCGTGGGGAAGTCAAAGGCAGCCGCAGTGTGCAGCAGACTCCGGCAGCGCTCCCCGTGCAGCACGACGCGGTCATAGGTGCAGTGGGTGCTGGCCCGCACTGTGGTGTCCTCCCCATCGGCAATCACCCAGTGGAAGCCTGGCTCAGTCCGCAGCTCCAGCTTGTCCAGGCGCTTTTTGGTCAGTGAAGCGCAGTCAGCATTGAAGTCCCCAAGCAGGATCACGTC
>ENST00000014935::X:154403269-154403381
TTGCTCTGCCAGTGCTGGGAGACCTCCAGAAACACATCGTAGAGGGCGTTCAGCTCCTTCTCTACGGCCTTAGGAGTGGTGTGCAGCGGGACCAACACCAGGCTGGGAAGGA
>ENST00000014935::X:154403522-154403622
ATTGCTGGGCAAAGAGAACTGGGCCACAAATGGCTCCCGGGCAAAGACGTCATCCTCATCGTTGTACACGTAGGAACTCAGGACCTGTGTTTTGTGTGAC
>ENST00000014935::X:154404828-154404914
GATAGAAGTACACATACGTCTCCATGTAGGTGCTGCGCCCCAGCTGGGGGCTGCTCAGGGTGCTGTAGGGCCCAGAGCCATCAAAT
>ENST00000055335::X:49269793-49270873
TTGGCTGCCCGCCCCTTCAGGCCCTGCCCCCGCCGGTCCCGCCGCCGGTGCCGTCGGTGCCGCCGCCGCCGCCGATATGGCGCGTACGGCCCCTGTGGAGCCCCCGCTGCGGCATTCCGCGCCCCCCTCGCCGGCCGCGGGTGAGCCCCGCACCTCGGTCGAGGCGGCGGTGGCCCCGCGGAGGGTGCTGTTCGCCGACGAGGCCTTGGGGCTGCCGCTGGCGCAGTTGCGCCGCTACCGGCCGTGGGGCGGGCCCGGGGCGGGCAAGATGGCGGCGGCGGCCGGGCAAGATGGCGGCGGCGGCGGCGGGGCCGACGAGGACGACGATGGCGAGGATGGGGATGAAGGGGAGGAGGAAGAGGAGGCTTGCCCCGAGCCCTCACCGCTGTGCCCCGTCCCCGCTGGCGGGGGGTTTTACCTGGTCCCCACATTTTCGCTGCCGCCCGCGCCGGGCCGTCTGGAGCGCTTGGGGCGCGTCATGGTGGAGCTGGAGGCGCTGCTGCCGCCTCCCGGAGCGGTCCCCGGGGGTGCCGGGGTGTGGGTGCCTGGGGGCCGCCCGCCGGTGCTGCGCGGGTTGGTACGCGTGCTGAACCGCTCCTTCGAGAAGGCGGTGCACGTGCGGGCCTCACACGACGGCTGGGCTTCCTTTTGCGACCACCCAGCGCGCTACGTCCCGCGCAGCCCGCCGTGGGCAGGAGCGGGAGGAACAGGAGCAGGAGATCCCATCCTGGATCCGGGGCTCGGCCTGGGTCCCGGCCAGGCATCCGCCTCCTCGCCCGACGACGGCGGCCGCACCGACCGCTTTGCCTTCCAGCTGCCCTTTGCTGAGGGCGCGGGCGATGGGGCGCGCCTCGACTTCGTGGTGCGCTATGAGACCCCTGAGGGCACTTTCTGGGCCAACAACCACGGCCGCAACTACACAGTCCTGCTCCGGATCGCACCCGCTCCCACACCCACTGATGCCGAAGGGCTGCCCCAGCAGCAGCAGCTGCCGCAGCTGGAGCCACAGCCCGAGTGCCAGGGTCCCGTGGAGGCTGAGGCCAGGCAGCTGAAGAGCTGCATGAAGCCGGTGAGGCGCAG
>ENST00000055335::X:49281406-49281461
CCTGCCGAGGAGGAACTGAAGACGAAGAACATGGATGATAACACCTTTGCCATGG
>ENST00000055335::X:49281981-49282063
AGAGCATCCTGATGTCCAGGAGTCAGTGGGTCCACTGGTAGCCCCCACCCCTCTCCGTCCATGGCCCCAGATGACACTTCAG
>ENST00000055335::X:49285834-49288090
TTTCTGACGTTCCGATGACTGGCAACCCCGCAGAAGAAGGTGATGTCCCCAGAAGCAGTCCACCTGTGGCTTTTACAGAGGTCCTCCAGGCACCGGCCATCAGGATTCCCCCCTCCTCCCCTCTCTGTGGCCTGGGTGGCTCCCCCAGAGACCAGGCCTCAGGGCCCGATGCGAGCGAGGGGGCCACCGGGCCTTTCCTGGAGCCCAGTCAGCAGCAGGCAGAGGCCACATGGGGAGTATCGAGTGAGAATGGAGGGGGGCTGG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CATCCCCAAGCTCTCCAGTCAACACAGGGCTCCCTGTGGTGACACCAGTGGAGATGAGGGAACGGGTAGATGGTGTGAGTGAGGGGAACTTTTAGAGTGGAACTGGGCATGTCCTCCGCCTACCCCCCGAGCCTGTATTTATTTTTGTATAATTCTCTGGATGAGGGAGAGTGGTCGTGAGCTGGTCTTGGGGCACAATTACCCAGAGATATATTTATTAACAGCCAACCTGTGCAACCTGCTGGAGCTTTATTTTTAATTTAATTTATATAGAGTACCTATTATTATATGCCACAATAGAGCTCTATGAGAAACAGTGTCTTGCGGTGTAGTGTTCTCCTGTTTGGGCATGAGTGTGCAGGGTGGTCACTTTCTGTGGGAGGATCACAGTGGGGAGTTGGGGGTGGGACGTGGTCGCCTGCTGCTGCTTCAACATGTCTTTCCTTGAAGATGTGTGTCTCCTCGTCTCGTGGTCCTAATCCATATGGTTCTTTGTCTTTTCCACATTCTGCCTGTGGGACCCTACAGGTGTGTATTTGGATGGTGGTGGTGGGAGCCAGGGAGGAAGAGTGGCAGCCACATGAGGGTTTGGTGTCAGTCACATGGTTGCAGTGGTAGCTGTGGTCTCCTGTGGATGTGGGGACATCAGTTGTGAATCAGCCACAAGGTTTTGAGGTTACTGAAAAAACAGCCTTTGACACCAGCAGGGAGACCCCTTAGTCCCTGAGATAAGGAAGGCCTCAGAAAGGAAAGAGGAGTTAATGTACTGCAGTACTTGGTAGCACAGTTGCTGTCCACAGACATCACATTTCTACTAAAAACAGGAAGCCCAGAAGCTTTGAAAGAAAGATATATATTTATTGCATGCAAATAAAAAACTGCTCAACAAAA
So after for loop command the Same transcript id only take as name and there respective sequence not take other transcript id. Like wise i want for my whole file. Example:--
var exons=[
{"name":"transcript1","seq":"AATCTGATGCTA"},
{"name":"transcript2","seq":"TCTGATGCTACC"},
{"name":"transcript3","seq":"CATGCTG"},
{"name":"transcript4","seq":"CCC"},
{"name":"transcript5","seq":"CATGCCCCTG"}
];
My file which I want after for loop command
var exons=[
{"name":"ENST00000055335::X:49269793-49270873","seq":"T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
{"name":"ENST00000055335::X:49281406-49281461","seq":"CCTGCCGAGGAGGAACTGAAGACGAAGAACATGGATGATAACACCTTTGCCATGG"},
{"name":"ENST00000055335::X:49281981-49282063","seq":"AGAGCATCCTGATGTCCAGGAGTCAGTGGGTCCACTGGTAGCCCCCACCCCTCTCCGTCCATGGCCCCAGATGACACTTCAG"},
{"name":"ENST00000055335::X:49285834-49288090","seq":"TTTCTGACGTTCCGATGACTGGCAACCCCGCAGAAGAAGGTGATGTCCCCAGAAGCAGTCCACCTGTGGCTTTTACAGAGGTCCTCCAGGCACCGGCCATCAGGATTCCCCCCTCCTCCCCTCTCTGTGGCCTGGGTGGCTCCCCCAGAGACCAGGCCTCAGGGCCCGATGCGAGCGAGGGGGCCACCGGGCCTTTCCTGGAGCCCAGTCAGCAGCAGGCAGAGGCCACATGGGGAGTATCGAGTGAGAATGGAGGGGGGCTGGAGGCTGTGAGTGGGTCAGAGGAGCTGCTCGGTGAGGACACCATCGACCAGGAGCTGGAGCAGCTCTACCTGTCTCACCTGAGCCGCCTACGGGCTGCTGTGGCTGCGGGTGGGGCAGGGGGTGGTGGGGAGGGCTCCACAGATGGAGGGATGTCCCCCAGCCATCCCCTGGGCATACTGACGGACCGCGACCTGATCTTGAAGTGGCCTGGCCCTGAGCGGGCCCTGAACAGCGCCCTGGCTGAGGAGATCACGCTGCACTATGCCCGGCTGGGGCGTGGCGTGGAGCTCATCAAGGACACCGAAGACCCTGATGATGAAGGGGAGGGTGAAGAGGGGCTCTCTGTCACACCCTCCAGCCCAGAAGGGGACAGCCCCAAGGAATCGCCTCCAGAAATCCTCTCCGGGGCCCGTTCTGTGGTAGCCACGATGGGAGATGTGTGGCTCCCATGGGCAGAGGGCTCAGGATGTGACGGCCCTGTGGTTCTGGGTACAGAGGGTCAGTTCATTGGGGATCCTGAGAAAGGGATGGGCAAGGACACCAGCTCTTTGCACATGAATAGGGTGATAGCTGGGGTGACTGAGTCCCTGGGGGAGGCCGGGACAGAAGCCCAGATAGAGG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TGGATGTGGGGACATCAGTTGTGAATCAGCCACAAGGTTTTGAGGTTACTGAAAAAACAGCCTTTGACACCAGCAGGGAGACCCCTTAGTCCCTGAGATAAGGAAGGCCTCAGAAAGGAAAGAGGAGTTAATGTACTGCAGTACTTGGTAGCACAGTTGCTGTCCACAGACATCACATTTCTACTAAAAACAGGAAGCCCAGAAGCTTTGAAAGAAAGATATATATTTATTGCATGCAAATAAAAAACTGCTCAACAAAA"},
];
So anyone tell me how to write forloop command for my whole file. Thanks in advance
This question needs to be much clearer.
On what basis are you selecting
ENST00000055335
and notENST00000014935
? Representing the fasta file as the dictionary format you want is easy enough, but you haven't explained how your desired output relates to the input.I've added code formatting to your post this time, but please use the button above the writing box that looks like a
101010
in future.No, I want to select all the transcripts one by one in a loop present in my file. This is the whole command for which i want to write for loop command:- So as I have different types of sequences in my fasta file. So which have same transcript id I want to select it and put it in the below commad like some transcript have 4 sequence and some have 5 sequence so all are consdiered it during for loop command :-- This is the whole command for which i want to write for loop command:-
As you see this ENST00000055335 transcript id have 4 sequences and this ENST00000014935 have 5 sequenced. So I want to write for loop command to select only one transcript id at a time. As you see I have already uploaded the example .So this "var exons=" consider one transcript at a time and create all possible combinations of transcripts possible.
Is that VBA or something (like doing that in Excel)???
That code comes from an answer provided by @Pierre in: A: creating virtual library preparation of all possible exons in a gene in human
Oh, ok, but there is no file parsing in the example..... So op wants to add code for fasta file parsing in javascript and then join all the exons.
yes, I want to add code before this javascript.
Here is some of my fasta sequence file and I want to add all these in the javascript and this will only possible through for loop command so anyone can help me how to write a for loop command for this javascript to get all possible exon files. I don't know how to write a for loop command for this script. Thanks in advance for your suggestions.
Please can anyone suggest to me how to do it. I am waiting for answers. Thanks in advance.
Select one transcript ID at a time and do what with it?
Your example and your desired output do not correspond, it just shows one of the exon IDs. You also need to be clear about what language you want to do this with.
In shell for example (with the exception of the latest version of bash), for the most part associative arrays (dictionaries) are not supported.
In python, you cannot have multiple dictionary entries with the same key, unless you wrap it in a list, which it looks like your code above does, but I'm not familiar with whatever that language is (I guess java or something)