User Profile
Collapse
-
GeneticsJustin replied to How do I split a text file without stripping the character I'm splitting at?in PythonThanks! That works perfectly! -
GeneticsJustin replied to How do I split a text file without stripping the character I'm splitting at?in PythonWould I have to convert my list to a string for this? Also, for "records = ["123", "456", "789"]" how would I get python to automatically fill in for the "123", "456", and "789" in your example? The text file I'm using is hundreds of thousands of characters long, so I can't possibly do this manually.Leave a comment:
-
GeneticsJustin started a topic How do I split a text file without stripping the character I'm splitting at?in PythonHow do I split a text file without stripping the character I'm splitting at?
Hi everyone, I'm new to python and would like to split a FASTA (text) file into each different gene (separated by a ">"), randomly sample a certain number of the sequences, and print the result. I have the program almost working correctly, but for some reason text.split('>') strips all of the ">"s from the file. If there's some way I can either remove this strip or add back in the ">" character that would...
No activity results to display
Show More
Leave a comment: