Ejemplo n.º 1
0
        /// <summary>
        /// Search sequence online in the corresponding DB
        /// </summary>
        public void RetrieveSequences()
        {
            WSDBFetchServerService db = new WSDBFetchServerService();

            foreach (PSIPIanalysissearchDBSequenceType p in ListProteins)
            {
                if (p.seq != null)
                {
                    continue;
                }
                if (p.SearchDatabase_ref.ToUpper() != "SDB_SWISSPROT")
                {
                    throw new ApplicationException("DB " + p.SearchDatabase_ref + " not supported");
                }
                Console.WriteLine("Retrieving " + p.accession + " ...");
                string fasta = db.fetchData("UNIPROT:" + p.accession, "fasta", "raw");
                fasta = fasta.Remove(0, fasta.IndexOf('\n'));
                string seq = "";
                foreach (string str in fasta.Split('\n'))
                {
                    seq += str;
                }
                p.seq = seq;        //seq.ToUpper();
            }
        }
        public string GetFASTA(string accessionNumber)
        {
            WSDBFetchServerService fetch = new WSDBFetchServerService();

            try
            {
                string result = fetch.fetchData("UniProtKB: Accession: " + accessionNumber, "FASTA", "RAW");
                return(result);
            }
            catch (Exception e)
            {
                string problem = "There was a Problem with your request. Please check that  your accession number is correct and that the record is on the UNIprotKB database.";
                return(problem);
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Search sequence online in the corresponding DB
 /// </summary>
 public void RetrieveSequences()
 {
     WSDBFetchServerService db = new WSDBFetchServerService();
     foreach( DBSequenceType p in ListProteins ) {
     if( p.Seq!= null )
         continue;
     if( p.searchDatabase_ref.ToUpper() != "SDB_SWISSPROT" )
         throw new ApplicationException( "DB " + p.searchDatabase_ref + " not supported" );
     Console.WriteLine( "Retrieving " + p.accession + " ..." );
     string fasta = db.fetchData("UNIPROT:"+p.accession, "fasta", "raw");
     fasta = fasta.Remove(0,fasta.IndexOf('\n'));
     string seq = "";
     foreach( string str in fasta.Split('\n') )
         seq += str;
     p.Seq = seq;//seq.ToUpper();
     }
 }