Ejemplo n.º 1
0
 private static bool isVCFStream(Stream stream, string MAGIC_HEADER_LINE)
 {
     try {
         byte[] buff = new byte[MAGIC_HEADER_LINE.Length];
         stream.Read(buff, 0, MAGIC_HEADER_LINE.Length);
         return(buff.SequenceEqual(VCFUtils.StringToBytes(MAGIC_HEADER_LINE)));
         //            String firstLine = new String(buff);
         //            return firstLine.startsWith(MAGIC_HEADER_LINE);
     } catch {            // (Exception e)
         return(false);
     } finally {
         stream.Close();
     }
 }
Ejemplo n.º 2
0
 /// <param name="test">  bases to test against
 /// </param>
 /// <returns>  true if this Allele contains the same bases as test, regardless of its reference status; handles Null and NO_CALL alleles </returns>
 public bool BasesMatch(string test)
 {
     return(BasesMatch(VCFUtils.StringToBytes(test.ToUpper())));
 }
Ejemplo n.º 3
0
 public static bool AcceptableAlleleBases(string bases, bool allowNsAsAcceptable)
 {
     return(AcceptableAlleleBases(VCFUtils.StringToBytes(bases), allowNsAsAcceptable));
 }
Ejemplo n.º 4
0
 /// <seealso cref= Allele(byte[], boolean)
 /// </seealso>
 /// <param name="bases">  bases representing an allele </param>
 /// <param name="isRef">  is this the reference allele? </param>
 public static Allele Create(string bases, bool isRef)
 {
     return(Create(VCFUtils.StringToBytes(bases), isRef));
 }
Ejemplo n.º 5
0
 /// <param name="bases">  bases representing an allele </param>
 /// <returns> true if the bases represent the well formatted allele </returns>
 public static bool AcceptableAlleleBases(string bases)
 {
     return(AcceptableAlleleBases(VCFUtils.StringToBytes(bases), true));
 }