ding-lab / msisensor

microsatellite instability detection using tumor only or paired tumor-normal data
MIT License
124 stars 55 forks source link

MSIsensor,how to classify the MSI high and MSI low? #11

Closed anything4share closed 6 years ago

anything4share commented 6 years ago

Dear beifang, Sorry liberty to disturb. I'm hongsen qu and a new for MSIsenor from China. Recently I have install MSIsenor and run the command "bash run.sh" for test,then I got the MSI score 100%(Number_of_Somatic_Sites %) which means microsatellite instability, and it also means MSI high, how to classify the MSI high and MSI low ? Looking forward to your reply.

morganbye commented 6 years ago

Here's what we use:

#!/bin/bash
#
# Generate summary file for MSIsensor analyses
#
# Inputs
# ======
# 1. MSIsensor output file (with full path)
#       e.g. /path/<sample>.msi.output
#
# 2. Output file (with full path)
#       e.g. /path/<sample>.MSI.summary.txt
#
# 3. Patient identifier
#       e.g. <sample>
#
# Outputs
# =======
# 1. a single text file
#       i.e.
#           75.00 percent of microsatellites were unstable
#           <sample> is likely => MSI-high
#
# Info
# ====
# Written by:   Morgan Bye
# Authored:     2017-11-06
# Version:      1.0
#
# History
# =======
# 1.0 - 2016-08-08
#     Initial write

if [[ $# -eq 3 ]]; then
    IN=$1
    OUT=$2
    PATIENT=$3
else
    echo "Usage: MSIsensor_summary.sh"
    echo "            <MSIsensor_file> <output_file> <patient_id>"
    echo
    exit 1
fi

SCORE=`tail -n1 $IN | cut -f3`

LABEL=`echo $SCORE | awk '{if ($1 <10) print "=>","MSS";
                    else if ($1 >30) print "=>", "MSI-high";
                    else if ($1 >10 && $1 <30) print "=>","MSI-low";
                    else print "=>NA";}'`

printf "$SCORE percent of microsatellites were unstable\n$PATIENT is likely $LABEL" > $OUT

Gives you an output file, for example:

0.34 percent of microsatellites were unstable
<patient> is likely => MSS
anything4share commented 6 years ago

mang thanks for your info.

qhs2011@163.com

发件人: Morgan Bye 发送时间: 2018-02-06 02:26 收件人: ding-lab/msisensor 抄送: qunosen; Author 主题: Re: [ding-lab/msisensor] MSIsensor,how to classify the MSI high and MSI low? (#11) Here's what we use:

!/bin/bash

#

Generate summary file for MSIsensor analyses

#

Inputs

======

1. MSIsensor output file (with full path)

e.g. /path/.msi.output

#

2. Output file (with full path)

e.g. /path/.MSI.summary.txt

#

3. Patient identifier

e.g.

#

Outputs

=======

1. a single text file

i.e.

75.00 percent of microsatellites were unstable

is likely => MSI-high

#

Info

====

Written by: Morgan Bye

Authored: 2017-11-06

Version: 1.0

#

History

=======

1.0 - 2016-08-08

Initial write

if [[ $# -eq 3 ]]; then IN=$1 OUT=$2 PATIENT=$3 else echo "Usage: MSIsensor_summary.sh" echo " " echo exit 1 fi SCORE=tail -n1 $IN | cut -f3 LABEL=echo $SCORE | awk '{if ($1 <10) print "=>","MSS"; else if ($1 >30) print "=>", "MSI-high"; else if ($1 >10 && $1 <30) print "=>","MSI-low"; else print "=>NA";}' printf "$SCORE percent of microsatellites were unstable\n$PATIENT is likely $LABEL" > $OUT

Gives you an output file, for example: 0.34 percent of microsatellites were unstable

is likely => MSS ― You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
Beifang commented 6 years ago

Appreciate for sharing your script. btw, we have a new version v0.3 in github now and it can process tumor only data for msi status detection.

supernifty commented 5 years ago

Thanks @morganbye this is really helpful - how did you choose the thresholds of 10 and 30?

morganbye commented 5 years ago

Sorry for taking so long to get back to you. But the short answer is that we had an analyst sit down with ~1000 patient samples and graph it out in R, the thresholds became pretty apparent.

supernifty commented 5 years ago

thanks @morganbye !