{"action":"closed","issue":{"url":"https://api.github.com/repos/compomics/moFF/issues/27","repository_url":"https://api.github.com/repos/compomics/moFF","labels_url":"https://api.github.com/repos/compomics/moFF/issues/27/labels{/name}","comments_url":"https://api.github.com/repos/compomics/moFF/issues/27/comments","events_url":"https://api.github.com/repos/compomics/moFF/issues/27/events","html_url":"https://github.com/compomics/moFF/issues/27","id":328746678,"node_id":"MDU6SXNzdWUzMjg3NDY2Nzg=","number":27,"title":"Detail on what pyMZML_xic_out does","user":{"login":"antortjim","id":13869571,"node_id":"MDQ6VXNlcjEzODY5NTcx","avatar_url":"https://avatars0.githubusercontent.com/u/13869571?v=4","gravatar_id":"","url":"https://api.github.com/users/antortjim","html_url":"https://github.com/antortjim","followers_url":"https://api.github.com/users/antortjim/followers","following_url":"https://api.github.com/users/antortjim/following{/other_user}","gists_url":"https://api.github.com/users/antortjim/gists{/gist_id}","starred_url":"https://api.github.com/users/antortjim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antortjim/subscriptions","organizations_url":"https://api.github.com/users/antortjim/orgs","repos_url":"https://api.github.com/users/antortjim/repos","events_url":"https://api.github.com/users/antortjim/events{/privacy}","received_events_url":"https://api.github.com/users/antortjim/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-06-02T14:02:22Z","updated_at":"2018-07-11T10:18:52Z","closed_at":"2018-07-11T10:18:52Z","author_association":"NONE","body":"Hi there\r\n\r\nI am carefully looking at how moFF works and I have stumbled upon a piece of code I cannot wrap my head around.\r\n\r\n```\r\ntimeDependentIntensities = []\r\nminpos = bisect.bisect_left(rt_list, minRT)\r\nmaxpos = bisect.bisect_left(rt_list, maxRT)\r\n\r\nfor specpos in range(minpos,maxpos):\r\n\t\tspecid = runid_list[specpos]\r\n\t\tspectrum = run[specid]\r\n\t\tif spectrum['scan start time'] > maxRT:\r\n\t\t\tbreak\r\n\t\tif spectrum['scan start time'] > minRT and spectrum['scan start time'] < maxRT:\r\n\t\t\t#print 'in ', specid\r\n\t\t\tlower_index = bisect.bisect(spectrum.peaks, (float(MZValue - ppmPrecision * MZValue), None))\r\n\t\t\tupper_index = bisect.bisect(spectrum.peaks, (float(MZValue + ppmPrecision * MZValue), None))\r\n\t\t\tmaxI = 0.0\r\n\t\t\tfor sp in spectrum.peaks[lower_index: upper_index]:\r\n\t\t\t\tif sp[1] > maxI:\r\n\t\t\t\t\tmaxI = sp[1]\r\n\t\t\tif maxI > 0:\r\n\t\t\t\ttimeDependentIntensities.append([spectrum['scan start time'], maxI])\r\n```\r\n\r\nThis for loop iterates over all MS1 spectra (as extracted by `scan_mzml()` in `rt_list`) that have a retention time within `minRT` and `maxRT`*. `bisect.bisect` reports the position in the `spectrum.peaks` list where a peak with a given MZValue would fit while keeping the list sorted (increasing MZ values). Then, I understand that the code goes through all the peaks within `lower_index` and `upper_index` and fetches the highest intensity available in that range.\r\n\r\nHowever, I am not sure about what `bisect.bisect` is doing nor what `spectrum.peaks` is.  Is `spectrum.peaks` a list of MS1 or MS2 peaks? If they are MS1 peaks, I thought a spectrum could only have 1 MS1 peak (that of the precursor ion). I don't understand how could there be several MS1 peaks for the same spectrum.\r\n\r\nI hope you could please shed some light onto this.\r\n\r\nThanks for your time and your input!\r\n\r\nBest\r\n\r\nAntonio\r\n\r\n"}}
{"actor":{"display_login":"Maux82"}}