Exemplo n.º 1
0
        /// <summary>
        /// Reads rna, peptide Fasta-Sequence(s) and generates HELMNotation
        /// </summary>
        /// <param name="fastaString"></param>
        /// <returns></returns>

        public static string FastaToHelm(string fastaString)
        {
            string helm     = null;
            string errorMsg = "Can't convert FASTA to Helm";

            if (UseWebEditor)
            {
                throw new InvalidCastException(errorMsg);                 // can't do yet
            }

            else
            {
                string helm1 = HelmService.GenerateHELMFromFastaPeptide(fastaString);
                if (helm1 == null)
                {
                    throw new InvalidCastException(errorMsg);
                }

                string helm2 = HelmService.GenerateHELMFromFastaRNA(fastaString);
                if (helm2 == null)
                {
                    throw new InvalidCastException(errorMsg);
                }

                if (helm1.Length >= helm2.Length)
                {
                    return(helm1);
                }
                else
                {
                    return(helm2);
                }
            }
        }
Exemplo n.º 2
0
        public static string FastaRnaToHelm(string fastaString)
        {
            string helm = null;

            if (UseWebEditor)
            {
                throw new InvalidCastException("Can't convert FASTA to Helm");                 // can't do yet
            }

            else
            {
                helm = HelmService.GenerateHELMFromFastaRNA(fastaString);
            }

            return(helm);
        }