Domanda

Using C++, I want to read a text file which includes characters and and, details of set of characters given by a special character ">". After reading it from the file I want to add all characters to an array. I have no idea, how to escape the detail lines and escape character "\n". Please help me to get the characters to an array without details and escape characters.

Here is my example text file.

>ENA|JH373222|JH373222.1 Canis lupus familiaris chromosome 32 genomic scaffold chr32
GAATTCGTAGGTTTTCAGGATGATTTGAAAGTTATTTAGGGGGATCCCTGGGTGGCGCAG
CGGTTTGGTGCCTGCCTTTGGCCCGGGGCGCGATCCTGGAGGCCTGGGATCGAATCCCAC
GTCGGGCTCCCTGCATGGAGCCTGCTTCTCCCTCTGCCTGTGTCTCTGCCTCTCTGTCTC
TCTCTGTGTAACTATCATGAATAAATAAATAAAATCTTAAAAAAAAAAGAAAGTTATTTA
GGTAATTTGGTGGGGACAGGTGACTTGGGGACCCTACTCTTCGGCCATCTTGCAGCCTCC
TACTCTGTTTTCCGATTAAAATTGTTTCTAGGCAATGGCATCTGGAGGGTCAATGAGAAA
È stato utile?

Soluzione

Just Googling "read fasta file c++" you can get answers like this (from Rosetta), this (from a cprogramming), and more. All ready code, that you can just copy and paste. Maybe a bit more time could have been used researching this online.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top