Skip to content

Commit

Permalink
v1.1.1 Added check for overlap of MS2 isolation window with MS1 scan …
Browse files Browse the repository at this point in the history
…range.
  • Loading branch information
chhh committed Nov 7, 2016
1 parent 9c0772b commit e10f6ea
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,30 @@ public static void finalizeScanCollection(IScanCollection scans) throws FilePars

Integer thisMsLevel = curScan.getMsLevel();
Integer chldMsLevel = childScan.getMsLevel();
if (precursor.getParentScanNum() == null
&& thisMsLevel != null && chldMsLevel != null && thisMsLevel + 1 == chldMsLevel) {
precursor.setParentScanNum(curScanNum);
if (precursor.getParentScanNum() == null && thisMsLevel != null && chldMsLevel != null && thisMsLevel + 1 == chldMsLevel) {

Double pLo = precursor.getMzRangeStart();
Double pHi = precursor.getMzRangeEnd();
Double sLo = curScan.getScanMzWindowLower();
Double sHi = curScan.getScanMzWindowUpper();
if (pLo != null && pHi != null && sLo != null && sHi != null) {
// if we know precursor isolation window and the scan's m/z scan range
// they must overlap
if (pLo <= sHi && sLo <= pHi) {
// they overlap!
if (pLo.equals(pHi)) { // it's a single point
precursor.setParentScanNum(curScanNum);
} else {
final double minOverlap = 0.75;
double overlap = Math.min(pHi, sHi) - Math.max(pLo, sLo);
precursor.setParentScanNum(curScanNum);
}
}

} else {
// otherwise blindly add it
precursor.setParentScanNum(curScanNum);
}
}

// this else condition seems to not hold when some scans were cut out from mzXML file with ProteoWizrd.
Expand Down
32 changes: 16 additions & 16 deletions MSFileToolbox/src/umich/ms/fileio/filetypes/LCMSDataSource.java
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/*
* Copyright 2016 Dmitry Avtonomov.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* Copyright 2016 Dmitry Avtonomov.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package umich.ms.fileio.filetypes;

import java.util.List;
Expand Down Expand Up @@ -163,5 +163,5 @@ public interface LCMSDataSource<T extends Index<?>> {
* @throws umich.ms.fileio.exceptions.FileParsingException
* @throws IllegalArgumentException
*/
public List<IScan> parse(List<Integer> scanNums) throws FileParsingException;
List<IScan> parse(List<Integer> scanNums) throws FileParsingException;
}
2 changes: 1 addition & 1 deletion MSFileToolbox/src/umich/ms/msfiletoolbox/MsftbxInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
* @author Dmitry Avtonomov
*/
public class MsftbxInfo {
public static final String version = "1.1.0";
public static final String version = "1.1.1";
}

0 comments on commit e10f6ea

Please sign in to comment.