Example #1
0
        public static IParamContainer SetCompression(
            this IParamContainer pc,
            BinaryDataCompressionType compressionType)
        {
            switch (compressionType)
            {
            case BinaryDataCompressionType.NoCompression:
                return(pc.SetNoCompression());

            case BinaryDataCompressionType.ZLib:
                return(pc.SetZlibCompression());

            default:
                throw new NotSupportedException("Compression type not supported: " + compressionType.ToString());
            }
        }
Example #2
0
        private void WriteParamGroup(IParamContainer pc)
        {
            var msParams = pc.CvParams.Where(x => IsMSParam(x) && HasValidOrEmptyUnit(x));

            foreach (var cvp in msParams)
            {
                writer.WriteStartElement("cvParam");

                WriteXmlAttribute("cvRef", "MS", true);
                WriteXmlAttribute("accession", cvp.CvAccession, true);
                WriteXmlAttribute("name", cvp.CvAccession, true);
                WriteXmlAttribute("value", cvp.GetStringOrDefault(), false);

                if (cvp.HasUnit())
                {
                    WriteXmlAttribute("unitCvRef", ParseCvRef(cvp.CvUnitAccession), true);
                    WriteXmlAttribute("unitAccession", cvp.CvUnitAccession, true);
                    WriteXmlAttribute("unitName", cvp.CvUnitAccession, true);
                }

                writer.WriteEndElement();
            }

            var userParams = pc.UserParams.Where(x => HasValidOrEmptyUnit(x));

            foreach (var up in userParams)
            {
                writer.WriteStartElement("userParam");

                WriteXmlAttribute("name", up.Name, true);
                WriteXmlAttribute("value", up.GetStringOrDefault(), false);

                if (up.HasUnit())
                {
                    WriteXmlAttribute("unitCvRef", ParseCvRef(up.CvUnitAccession), true);
                    WriteXmlAttribute("unitAccession", up.CvUnitAccession, true);
                    WriteXmlAttribute("unitName", up.CvUnitAccession, true);
                }

                writer.WriteEndElement();
            }
        }
Example #3
0
        public static IParamContainer SetBinaryDataType(
            this IParamContainer pc,
            BinaryDataType binaryDataType)
        {
            switch (binaryDataType)
            {
            case BinaryDataType.Float32:
                return(pc.Set32BitFloat());

            case BinaryDataType.Float64:
                return(pc.Set64BitFloat());

            case BinaryDataType.Int32:
                return(pc.Set32BitInteger());

            case BinaryDataType.Int64:
                return(pc.Set64BitInteger());

            default:
                throw new NotSupportedException("Data type not supported: " + binaryDataType.ToString());
            }
        }
Example #4
0
 public static bool IsZlibCompression(
     this IParamContainer pc)
 {
     return(pc.HasCvParam("MS_1000574"));
 }
Example #5
0
 /// <summary>
 /// Signed 32-bit little-endian integer. [PSI:MS]
 /// </summary>
 public static IParamContainer Set32BitInteger(
     this IParamContainer pc)
 {
     return(pc.SetCvParam("MS:1000519").NoUnit());
 }
Example #6
0
 public static bool Is32BitInteger(
     this IParamContainer pc)
 {
     return(pc.HasCvParam("MS:1000519"));
 }
Example #7
0
 /// <summary>
 /// 32-bit precision little-endian floating point conforming to IEEE-754. [PSI:MS]
 /// </summary>
 public static IParamContainer Set32BitFloat(
     this IParamContainer pc)
 {
     return(pc.SetCvParam("MS:1000521").NoUnit());
 }
Example #8
0
 public static bool Is32BitFloat(
     this IParamContainer pc)
 {
     return(pc.HasCvParam("MS:1000521"));
 }
Example #9
0
 /// <summary>
 /// Compression using MS-Numpress short logged float compression. [https://github.com/fickludd/ms-numpress]
 /// </summary>
 public static IParamContainer SetMSNumpressShortLoggedFloatCompression(
     this IParamContainer pc)
 {
     return(pc.SetCvParam("MS:1002314").NoUnit());
 }
Example #10
0
 internal ParamEdit(IParamContainer pc)
 {
     this.ParamContainer = pc;
 }
Example #11
0
 /// <summary>
 /// Compression using MS-Numpress linear prediction compression. [https://github.com/fickludd/ms-numpress]
 /// </summary>
 public static IParamContainer SetMSNumpressLinearPredictionCompression(
     this IParamContainer pc)
 {
     return(pc.SetCvParam("MS:1002312").NoUnit());
 }
Example #12
0
 /// <summary>
 /// Compression using MS-Numpress positive integer compression. [https://github.com/fickludd/ms-numpress]
 /// </summary>
 public static IParamContainer SetMSNumpressPositiveIntegerCompression(
     this IParamContainer pc)
 {
     return(pc.SetCvParam("MS:1002313").NoUnit());
 }
Example #13
0
 /// <summary>
 /// Zlib (gzip) Compression. [PSI:MS]
 /// </summary>
 public static IParamContainer SetZlibCompression(
     this IParamContainer pc)
 {
     return(pc.SetCvParam("MS_1000574").NoUnit());
 }
Example #14
0
 public static IParamEdit BeginParamEdit(
     this IParamContainer pc)
 {
     return(new ParamEdit(pc));
 }
Example #15
0
 public static bool IsNoCompression(
     this IParamContainer pc)
 {
     return(pc.HasCvParam("MS:1000576"));
 }
Example #16
0
 /// <summary>
 /// No Compression. [PSI:MS]
 /// </summary>
 public static IParamContainer SetNoCompression(
     this IParamContainer pc)
 {
     return(pc.SetCvParam("MS:1000576").NoUnit());
 }
Example #17
0
 public static bool IsTimeArray(
     this IParamContainer pc)
 {
     return(pc.HasCvParam("MS:1000595"));
 }
Example #18
0
 public static bool IsIntensityArray(
     this IParamContainer pc)
 {
     return(pc.HasCvParam("MS:1000515"));
 }
Example #19
0
 /// <summary>
 /// A data array of m/z values. [PSI:MS]
 /// </summary>
 public static IParamContainer SetMzArray(
     this IParamContainer pc)
 {
     return(pc.SetCvParam("MS:1000514").PSIMS_Mz());
 }