public bool ShareProteinId(ProteinSpectrumMatchSet other) { foreach (var prsm1 in this) { foreach (var prsm2 in other) { if (prsm1.ProteinId.Equals(prsm2.ProteinId)) { return(true); } } } return(false); }
public ProteinSpectrumMatchSet[][] GroupAcrossRuns(List <ProteinSpectrumMatchSet>[] prsmGroup, INodeComparer <ProteinSpectrumMatchSet> prsmGroupComparer) { var nDataset = prsmGroup.Length; var prsmSet = new NodeSet <ProteinSpectrumMatchSet>() { }; for (var i = 0; i < nDataset; i++) { var groupedPrsms = prsmGroup[i]; if (groupedPrsms == null) { continue; } prsmSet.AddRange(groupedPrsms); } var alignedPrsms = prsmSet.ConnnectedComponents(prsmGroupComparer); var alignedResult = new ProteinSpectrumMatchSet[alignedPrsms.Count][]; for (var i = 0; i < alignedResult.Length; i++) { alignedResult[i] = new ProteinSpectrumMatchSet[nDataset]; } for (var i = 0; i < alignedPrsms.Count; i++) { foreach (var set in alignedPrsms[i]) { if (alignedResult[i][set.DataId] != null) { alignedResult[i][set.DataId].Merge(set); //Console.WriteLine("[{4}] {0}-{1}...{2}-{3}", set.MinScanNum, set.MaxScanNum, alignedResult[i][set.DataId].MinScanNum, alignedResult[i][set.DataId].MaxScanNum, set.DataId); } else { alignedResult[i][set.DataId] = set; } } } return(alignedResult); }
public LcMsFeature(double repMass, int repCharge, double repMz, int repScanNum, double abundance, int minCharge, int maxCharge, int minScan, int maxScan, double minElution, double maxElution, double minNet = 0, double maxNet = 0) { Abundance = abundance; RepresentativeMass = repMass; RepresentativeCharge = repCharge; RepresentativeMz = repMz; RepresentativeScanNum = repScanNum; MinCharge = (minCharge > 0) ? minCharge : repCharge; MaxCharge = (maxCharge > 0) ? maxCharge : repCharge; MinScanNum = (minScan > 0) ? minScan : repScanNum; MaxScanNum = (maxScan > 0) ? maxScan : repScanNum; MinElutionTime = minElution; MaxElutionTime = maxElution; MaxNet = maxNet; MinNet = minNet; ProteinSpectrumMatches = new ProteinSpectrumMatchSet(0); }
public void Merge(ProteinSpectrumMatchSet other) { AddRange(other); }