while I want extract these sequence with 4 sequence in a separate file with a name, that means I have 64 sequences I want them separate into 16 files with each have 4 sequences and with a different name. Is there any perl script or other way to do this? Thank you
In that case he can make a new file using the following command: grep -v "^>" Original_file > Newfile. This file will only have sequences. Now he will have to use split --lines 4 instead of 8.
I don't know what "a little" means, in this context--either operationally or stipulatively. I also didn't know that bioinformatics requires a programming background for admission. If not, however, perhaps the OP is just now nurturing his/her emerging programming skills, since a certain level of proficiency ("a little"?) is required at some point in the OP's matriculation.
Well dpryan79 is not entirely wrong. He has helped a lots of beginners by answering their questions. But lately we have been getting many trivial questions. People don't try enough before posting their questions to the forum. The best thing would be to also post whatever you have tried so far along with the real question. This will show that the user has made sincere effort to resolve the problem.
Your point is well made, and I didn't mean to suggest that dpryan79 was wrong. Even in my solution I mentioned that it would be nice to see some problem-solving attempts. I sometimes have a hard time with the use of the word 'trivial' in programming contexts, since I know that what would be 'trivial' to some programmers would make my brain hurt.
Why don't you try "split". Each entry takes 2 lines (1 header and 1 for sequence). You have total of 64x2= 128 lines. Now try this command on UNIX:
split --lines 8 Original_file (It should give you 16 files)
Unless I'm mistaken, that will not work. It's appears that the OP wants only four extracted sequences in each of the 16 files--no headers.
In that case he can make a new file using the following command: grep -v "^>" Original_file > Newfile. This file will only have sequences. Now he will have to use split --lines 4 instead of 8.
This is a nice solution.
There's probably not one floating around anywhere, but you could trivially write one.
Perhaps not so 'trival' for the OP...
Then the OP should find a different field. Those who can't program at least a little have no business in bioinformatics.
I don't know what "a little" means, in this context--either operationally or stipulatively. I also didn't know that bioinformatics requires a programming background for admission. If not, however, perhaps the OP is just now nurturing his/her emerging programming skills, since a certain level of proficiency ("a little"?) is required at some point in the OP's matriculation.
Well dpryan79 is not entirely wrong. He has helped a lots of beginners by answering their questions. But lately we have been getting many trivial questions. People don't try enough before posting their questions to the forum. The best thing would be to also post whatever you have tried so far along with the real question. This will show that the user has made sincere effort to resolve the problem.
Your point is well made, and I didn't mean to suggest that dpryan79 was wrong. Even in my solution I mentioned that it would be nice to see some problem-solving attempts. I sometimes have a hard time with the use of the word 'trivial' in programming contexts, since I know that what would be 'trivial' to some programmers would make my brain hurt.