2 Methods to Find Peaks in Mass Spectrometry Data Using Python

Поділитися
Вставка
  • Опубліковано 14 жов 2024
  • This video tutorial focuses on finding peaks in mass spectrometry data using two methods, namely the Peak Utils library and SciPy. The tutorial goes in-depth on how to tune the peak picking arguments for both approaches with a particular emphasis on key parameters such as prominence, peak height, peak width, and threshold. By following the tutorial, viewers can acquire an in-depth understanding of the underlying principles of peak detection in mass spectrometry data and learn how to fine-tune parameters for accurate and reliable results.
    Github: github.com/chr...
    peak_picking: • 2 Methods to Find Peak...
    baseline correction: • How to Baseline Correc...
    Signal Filtering: • Analytical Signal Proc...

КОМЕНТАРІ • 67

  • @erikhristev2613
    @erikhristev2613 9 місяців тому +1

    Amazing video ❤❤❤

    • @CJP3
      @CJP3  9 місяців тому

      Thanks SpongeBob! 😂

  • @Mr.Roulette.Science
    @Mr.Roulette.Science Рік тому +2

    I've watched several Python and data science tutorials lately. As somebody who doesn't really code much, this is EASILY the clearest one. Nice work.

    • @CJP3
      @CJP3  Рік тому +2

      Thank you very much! I checked out your roulette video 🔥 🔥 🔥

    • @simonmasters3295
      @simonmasters3295 6 місяців тому

      Good comment

  • @xfry
    @xfry Місяць тому +1

    Bro, I'm so proud of you! Thank you for this content :D

    • @CJP3
      @CJP3  Місяць тому

      Thanks boss! 🙏🏽

  • @philipjohnson5288
    @philipjohnson5288 2 місяці тому +1

    I have just found your signal processing series. Excellent. I have a question that I hope you can shed some light one.
    I use SciPy fft, fftfreq, and find_peaks, and have found that the amplitudes of the peaks found are hugely different (i.e. fft amplitude of a peak is 1200 and find_peaks has an amplitude of 0.65. Any insight would be appreciated. Thanks.

    • @CJP3
      @CJP3  25 днів тому

      Howdy! Thanks for the comment and great question! These differences stem from how each function processes and scales the data. You can achieve the same scale by normalizing the data.

  • @RafaelAnisShaikhzadeh
    @RafaelAnisShaikhzadeh 4 місяці тому

    Thank you so much! Currently trying to work with analysis of absorption spectra graphs in uni, and that's shown to be really helpful!

    • @CJP3
      @CJP3  4 місяці тому

      You're very welcome!

  • @SomayaRiffi
    @SomayaRiffi 3 місяці тому +1

    First of all, I would like to thank you for your explanation..
    I have some questions for this method. My experimental data has 1600 information about modal analysis ( frequencies Vs Magnitudes )
    So, how can identify the most good peaks with this PPM?
    (I'm not good in python)

    • @CJP3
      @CJP3  3 місяці тому

      Hi Somaya! a couple questions to guide the answer. How are you defining “good peaks” tallest peaks? Best resolved? What is the nature of the data? Scipy has a lot of tools for what you’re generally describing but which specific combination of methods will depend on the nature of the data and the questions above.
      Happy to help more!

  • @raphaelstone6297
    @raphaelstone6297 11 місяців тому

    Thanks so much, this was really helpful for me as someone new to coding! I've used this to analyse PXRD patterns, so pretty similar to mass spec data.

    • @CJP3
      @CJP3  11 місяців тому

      Glad it was helpful! Interestingly, I have used many of these scripts developed for the videos on X-ray scattering data myself!

  • @sachintaak6613
    @sachintaak6613 3 місяці тому +1

    i am working on some protein mass spectra need help how can i connect with you , your video tutorials are very helpful for a undergraduate like me

    • @CJP3
      @CJP3  3 місяці тому

      Let connect in LinkedIn! Look forward to it

  • @mk6289l
    @mk6289l 6 місяців тому +2

    A beautiful voice that sounds reminiscent of listening to a jazz singer.

    • @CJP3
      @CJP3  6 місяців тому +1

      🎵 that’s awesome!!! Thanks for the kind words 🎷!!

  • @eggertgudmundsson7845
    @eggertgudmundsson7845 Рік тому

    ..Thank you and THANK you! :) I was looking for what you explained so well. You sir just saved me a bunch of time! I was looking for a way to pick out the 10 most prominent spectral features in a spectrogram without having to write a lot of code myself. pls Keep it up! :)

    • @CJP3
      @CJP3  Рік тому

      Glad it was helpful!! Thanks for letting me know!! 😃

  • @Donquixote-qv7sp
    @Donquixote-qv7sp 9 місяців тому

    Nice video. What are you using to do your diagrams? an Ipad? also, where can I find the data you used so I can follow along?

    • @CJP3
      @CJP3  8 місяців тому

      Howdy! Yep, I use an Ipad + OBS for screen recording. The data work I collected in Grad School. I think I can upload it Github.

  • @humanintheloop
    @humanintheloop 10 місяців тому +2

    Would appreciate more if no background music. Otherwise very interesting and well presented.

    • @CJP3
      @CJP3  10 місяців тому

      Thanks! The more recent videos have either less music or no music.

  • @matthewbauer5847
    @matthewbauer5847 Рік тому +1

    Interesting to see your walkthrough and thanks for sharing. I've used script.signal.find_peaks for locating the position of plotted data in scanned images from means across each axis. Ie a0 = np.mean(img_a, axis=0) & a1 = np.mean(img_a, axis=1). Noise is always a problem but I've had luck subtracting a smoothed version from the original.

    • @CJP3
      @CJP3  Рік тому

      Whoa! So you take and image, convert it to an array and then do that processing you just mentioned? 🤯

  • @AI_BotBuilder
    @AI_BotBuilder Рік тому +3

    Can you do one where you find the peaks , global maxima and minima, when the data is non stationary, like in the case of stock prices? Thankyou for this video!

    • @AI_BotBuilder
      @AI_BotBuilder Рік тому

      Foward looking is alright, look ahead is fine as my usecase is different, but identifying them is the goal and I find it difficult. I would appreciate your help. :)

    • @CJP3
      @CJP3  Рік тому

      Very interesting idea! Let me see if I can find an interesting dataset to try this on.

  • @MilaCvetković-t9w
    @MilaCvetković-t9w 11 місяців тому

    Wonderful video! How can I find the starting point of a peak? It is very important in acoustics analysis.

    • @CJP3
      @CJP3  11 місяців тому +1

      Howdy! Thank for watching the video. Does this video get at what you're thinking about: ua-cam.com/video/wAmlfQqhCh0/v-deo.html
      If not I'll dig more into this idea :)

    • @MilaCvetković-t9w
      @MilaCvetković-t9w 11 місяців тому

      Wow, will definitely try it! Thanks!

  • @thanoskalamaris8891
    @thanoskalamaris8891 10 місяців тому

    Is there any robust, mathematically-backed methodology to define the prominence of the dataset without prior knowledge to it?

    • @CJP3
      @CJP3  10 місяців тому

      Hi, you would need to have a metric for the S/N threshold and sufficient signal processing to clean up the data. For that reason EDA and a visual assessment of the data is a good start. Furthermore, you could ML techniques like DBSCAN to estimate peak threshold values but this would still likely require an iterative process.

    • @thanoskalamaris8891
      @thanoskalamaris8891 10 місяців тому

      @@CJP3 Thank you for your shift response. Visual assessment is out of conversation as we try to automate exactly this. I will try the solutions you proposed. Much appreciated

  • @adefault843
    @adefault843 8 місяців тому

    Man, this video is just awesome, but i am really struggling with how do i transform my RAW data into excel files so i can find the peaks in python. I am a coding beginner so i am still learning the basics, and your vid really help me seeing the bigger picture!

    • @CJP3
      @CJP3  8 місяців тому

      Thanks for the kind words! Is your raw data a .RAW file? If so, from what instrument?

    • @adefault843
      @adefault843 7 місяців тому

      @@CJP3 Yes it is a .RAW data, im using an LC/MS instrument to get the data. I've tried to download the MZconvert and MS-DIAL but none of them worked for me. How do you convert your files in your Mac?
      Thanks for the kindness, your the best!

  • @bArda26
    @bArda26 25 днів тому

    thank you!

    • @CJP3
      @CJP3  24 дні тому

      My pleasure!!

  • @owaistoru
    @owaistoru 8 місяців тому +1

    Hi , i have the signal FFT of time domain, which is divided in segment, i want to find the peaks od each segment before applying clustering method, but i want to take both the frequency and magnitude into consideration in clusters, what should i do, i can see in you are taking just the magnitude of each peak ..

    • @CJP3
      @CJP3  8 місяців тому

      Howdy! Can you say more about out the raw data? Is it in the frequency domain?

    • @owaistoru
      @owaistoru 8 місяців тому

      @@CJP3 the raw data was just the energy imbalance (generation-load) in hourly interval, it was in time domain , i created segment before applying fft . i took FFT to convert to frequency domain , now i want to find peaks but considering both Frequency and Time . i am sorry for my English if it is still not clear , i can phrase it differently . thank you for the time

  • @ren.oooooo
    @ren.oooooo 9 місяців тому

    Do you have any suggestions to detect dips?

    • @CJP3
      @CJP3  9 місяців тому +1

      Howdy! I’d consider processing the signal using 1/x to invert what is considered a peak.

  • @subratasarkar1427
    @subratasarkar1427 Рік тому +1

    How can I detect p,q,r,s,t peak in a ECG data can you please explain?

    • @CJP3
      @CJP3  Рік тому

      There are specific python libraries that can detect waveforms like those in ECGs. One such is Biosppy. I’ve never tried it. Good luck!

  • @carly9702
    @carly9702 Рік тому

    Thanks for your help

    • @CJP3
      @CJP3  Рік тому

      My pleasure! Thanks for watching!!

  • @connorhenning786
    @connorhenning786 Рік тому

    Is there a way to have python count the number of peaks, I'm working with a data set that may contain a couple hundred peaks to a thousand peaks, I'm working on counting interference fringe lines from a laser aimed at an Arduino photo diode detector and I don't want to have to count up the red dots manually.

    • @CJP3
      @CJP3  Рік тому

      Hi Connor! It is possible to build a script to have Python count peaks. If using scipy.find_peaks you can measure the line the peak list. Len(peak_list).
      However, I think based on your description you have signal - peaks and interference - peaks the same spectrum.

    • @connorhenning786
      @connorhenning786 Рік тому +1

      @CJP3 so the data I'm looking at is just spikes plotted voltage vs time.

    • @CJP3
      @CJP3  Рік тому

      Hmm that would be an interesting video! Let me see if I can find an analogous dataset.

  • @CJP3
    @CJP3  Рік тому +2

    What techniques do you use to clean your analytical data? 🤓

  • @connorhenning786
    @connorhenning786 Рік тому

    For some reason on my plot the red marks at the peaks are not showing up

    • @CJP3
      @CJP3  Рік тому

      Howdy, did the line plot show up?

    • @connorhenning786
      @connorhenning786 Рік тому

      @CJP3 when I comment out the scatter plot to check the p1 array thats generated, theres nothing in the array. For the most part I've copied everything line for line except the renaming of the columns and file path

    • @connorhenning786
      @connorhenning786 Рік тому

      @@CJP3 I figured it out, i had to omit the values in the line 'p1=indexes(df.v.values....)' to 'p1=indexes(df.v...), where v is my voltage values i want to use as the y value reference in the scatterplot.

  • @AdityaKailaje
    @AdityaKailaje 16 днів тому

    great video but please turn down the music

    • @CJP3
      @CJP3  16 днів тому

      No problem!! Thanks for the feedback

  • @Elisa-ix8eg
    @Elisa-ix8eg Рік тому +1

    This Video really helped me a lot, but for a Python Tutorial your Voice and the Music is awkwardly sexy 😅

    • @CJP3
      @CJP3  Рік тому

      Haha Thank you for the compliment! What type of data are you working with?

  • @chukrob4904
    @chukrob4904 8 місяців тому

    The bgm is like reading in a o club that is stupid

    • @CJP3
      @CJP3  8 місяців тому

      lol I don’t use it as frequently in newer videos

  • @leenfield
    @leenfield Рік тому +2

    Can you stop the background music, very distracting

    • @CJP3
      @CJP3  Рік тому +1

      Howdy, I took a poll about whether to keep or drop the background music and the jury was split. So instead I looked at the analytics and retention is higher with background music. To compromise I don’t have it in all the videos. Sorry it’s distracting!