Esempio n. 1
0
 void parseSeqs(string filename, SeqSet &data) {
     ifstream input;
     SeqStream input_stream(openSeqFile(filename, input));
     if(!input_stream.good()) {
         throw("File stream is in a bad state");
     }
     string format = guessFormat(input_stream);
     if(format == "fasta") {
         try {
             parseFasta(input_stream, filename, data);
         } catch(...) {
             input.close();
             throw;
         }
     } else if(format == "fastq") {
         try {
             parseFastq(input_stream, filename, data);
         } catch(...) {
             input.close();
             throw;
         }
     } else {
         input.close();
         throw("Unrecognized format");
     }
     input.close();
 }
Esempio n. 2
0
 void CEPasteDialog::refresh()
 {
   switch (guessFormat(m_text)) {
   case InvalidFormat:
   default:
     refreshInvalidFormat();
     break;
   case VaspFormat:
     refreshVaspFormat();
     break;
   }
 }
Esempio n. 3
0
  void CEPasteDialog::accept()
  {
    switch (guessFormat(m_text)) {
    case InvalidFormat:
    default:
      break;
    case VaspFormat:
      if (!acceptVaspFormat()) {
        return;
      }
      break;
    }

    QDialog::accept();
  }
Esempio n. 4
0
 string guessFormat(SeqStream s) {
     string format = "";
     return guessFormat(s, format);
 }