Results 1 to 4 of 4
Thread: arrayList in a while loop
- 11-03-2011, 11:59 PM #1
arrayList in a while loop
I got a little bit of code I am kinda stuck with.
I got this arrayList where we stored a fasta file.
Now I would like to make a while loop where he constantly takes the next >seq... (and the lines below) and do something with it.Java Code:Fasta file example: >seq1 guguurguorgungun ionjlimlmo >seq2 jjkliuihlni >seq3 ppokkpdgstdcbch mdhdgsvtxtgsgwd jdbuydfyhedgy
But the problem is, how do I get it to take the next >seq...
I was thinking of letting it count++;
But overall, how can I find a certain ietm in the arrayList? (Like this ">")
I don't know if indexOf would help?
- 11-04-2011, 12:31 AM #2
Re: arrayList in a while loop
If the ArrayList contains String objects, then you should be able to find the String: ">"how can I find a certain ietm in the arrayList? (Like this ">")
But if the '>' is embedded in a longer String or class, you will have to get each object in the list and look in the object's contents.
- 11-06-2011, 11:02 PM #3
Re: arrayList in a while loop
We now made a function getProtein. And what getProtein does is he takes every >seq and the lines below.
Now the idea was something like this:
int count = 0;
// Do something to continue to the next with getProtein function (>seq2 etc.)
count++;
Do you maybe have any idea on this one?
Like how to get the next >seq...
- 11-06-2011, 11:28 PM #4
Similar Threads
-
How to run a for-each loop through an ArrayList?
By simon.black325 in forum New To JavaReplies: 6Last Post: 09-08-2011, 04:18 AM -
foreach loop on ArrayList<Stack<String>>
By Ciwan in forum New To JavaReplies: 21Last Post: 06-27-2011, 07:29 PM -
Problems with a loop calling data from an ArrayList.
By moriarty in forum New To JavaReplies: 30Last Post: 03-28-2010, 02:00 AM -
Iterating through ArrayList using For loop
By Java Tip in forum Java TipReplies: 0Last Post: 01-20-2008, 08:53 AM -
Iterating through ArrayList - traditional for loop
By Java Tip in forum Java TipReplies: 0Last Post: 11-14-2007, 03:22 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks