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(); } }
/// <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()))); }
public static bool AcceptableAlleleBases(string bases, bool allowNsAsAcceptable) { return(AcceptableAlleleBases(VCFUtils.StringToBytes(bases), allowNsAsAcceptable)); }
/// <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)); }
/// <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)); }