Skip to content

Commit

Permalink
feat: Add the "--PERCENT,P" option
Browse files Browse the repository at this point in the history
  • Loading branch information
lgmgeo committed Jul 23, 2024
1 parent 1220cc6 commit 1734618
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 15 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,12 @@
--OUTPUTFILE,-O <File> The liftover SV VCF output file
Required

--PERCENT,-P <float> Variation in length authorized for a lifted SV (e.g. difference max between SVLEN < 5%)
Default value: 0.05

--REFFASTASEQ,-R <File> The reference sequence (fasta) for the TARGET genome build (i.e., the new one after the liftover)
```
## liftoverSV: version 1.0.0_beta
## liftoverSV: version 0.1.1_beta

* Lift over #CHROM and POS

Expand Down
2 changes: 1 addition & 1 deletion bin/liftoverSV
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env tclsh

############################################################################################################
# liftoverSV 1.0.0_beta #
# liftoverSV 0.1.1_beta #
# #
# Copyright (C) 2024-current Veronique Geoffroy ([email protected]) #
# #
Expand Down
24 changes: 21 additions & 3 deletions changeLog.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,33 @@
############################################################################################################
# liftoverSV 1.0.0_beta #
# liftoverSV 0.1.1_beta #
# #
# Copyright (C) 2024-current Veronique Geoffroy ([email protected]) #
# #
# This program is free software; you can redistribute it and/or #
# modify it under the terms of the GNU General Public License #
# as published by the Free Software Foundation; either version 3 #
# of the License, or (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program; If not, see <http://www.gnu.org/licenses/>. #
############################################################################################################


For more details, please see the README file.


July, 12, 2024, liftoverSV version 1.0.0_beta

July, 23, 2024, liftoverSV version 0.1.1_beta

- Add the --PERCENT,P option


July, 12, 2024, liftoverSV version 0.1.0_beta

liftoverSV: Lifts over a Structural Variation VCF file from one reference build to another.

Expand All @@ -24,6 +42,6 @@ July, 12, 2024, liftoverSV version 1.0.0_beta
Case4: the distance between the two lifted positions changes significantly (difference between both SVLENs > 5%)

- Lift over INFO/SVLEN, INFO/SVSIZE



6 changes: 4 additions & 2 deletions share/doc/liftoverSV/commandLineOptions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ OPTIONS
See http://hgdownload.soe.ucsc.edu/downloads.html#terms for where to download chain files.
Required

--help,-h <Boolean> Display the help message
Default value: false. Possible values: {true, false}
--help,-h Display the help message

--INPUTFILE,-I <File> The SV VCF input file
Required
Expand All @@ -27,6 +26,9 @@ OPTIONS
--OUTPUTFILE,-O <File> The liftover SV VCF output file
Required

--PERCENT,-P <float> Variation in length authorized for a lifted SV (e.g. difference max between SVLEN < 5%)
Default value: 0.05

--REFFASTASEQ,-R <File> The reference sequence (fasta) for the TARGET genome build (i.e., the new one after the liftover)


Expand Down
15 changes: 13 additions & 2 deletions share/tcl/liftoverSV/liftoverSV-config.tcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
############################################################################################################
# liftoverSV 1.0.0_beta #
# liftoverSV 0.1.1_beta #
# #
# Copyright (C) 2024-current Veronique Geoffroy ([email protected]) #
# #
Expand Down Expand Up @@ -29,12 +29,13 @@ proc configureLiftoverSV {argv} {
#######################
set g_liftoverSV(BEDTOOLS) "bedtools"
set g_liftoverSV(LIFTOVER) "liftOver"
set g_liftoverSV(PERCENT) "0.05"


##################################
## Load options given in arguments
##################################
set lOptionsOk "B BEDTOOLS C CHAIN h help I INPUTFILE L LIFTOVER O OUTPUTFILE R REFFASTASEQ"
set lOptionsOk "B BEDTOOLS C CHAIN h help I INPUTFILE L LIFTOVER O OUTPUTFILE P PERCENT R REFFASTASEQ"

set i 0
set j 1
Expand All @@ -54,6 +55,8 @@ proc configureLiftoverSV {argv} {
set optionName LIFTOVER
} elseif {$optionName eq "O"} {
set optionName OUTPUTFILE
} elseif {$optionName eq "P"} {
set optionName PERCENT
} elseif {$optionName eq "R"} {
set optionName REFFASTASEQ
} elseif {$optionName eq "h" || $optionName eq "help"} {
Expand Down Expand Up @@ -163,4 +166,12 @@ proc configureLiftoverSV {argv} {
}
}

## PERCENT: should be defined between 0 and 1.
if {$g_liftoverSV(PERCENT) < 0 || $g_liftoverSV(PERCENT) > 1} {
puts "Bad option value: --PERCENT = $g_liftoverSV(PERCENT)"
puts "Should be in the \[0-1\] range values, default = 0.05"
exit 2
}


}
2 changes: 1 addition & 1 deletion share/tcl/liftoverSV/liftoverSV-extractDNAseq.tcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
############################################################################################################
# liftoverSV 1.0.0_beta #
# liftoverSV 0.1.1_beta #
# #
# Copyright (C) 2024-current Veronique Geoffroy ([email protected]) #
# #
Expand Down
2 changes: 1 addition & 1 deletion share/tcl/liftoverSV/liftoverSV-general.tcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
############################################################################################################
# LiftOver_SVs_from_VCF 1.0.0_beta #
# LiftOver_SVs_from_VCF 0.1.1_beta #
# #
# Copyright (C) 2024-current Veronique Geoffroy ([email protected]) #
# #
Expand Down
2 changes: 1 addition & 1 deletion share/tcl/liftoverSV/liftoverSV-help.tcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
############################################################################################################
# liftoverSV 1.0.0_beta #
# liftoverSV 0.1.1_beta #
# #
# Copyright (C) 2024-current Veronique Geoffroy ([email protected]) #
# #
Expand Down
6 changes: 3 additions & 3 deletions share/tcl/liftoverSV/liftoverSV-liftAndWrite.tcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
############################################################################################################
# liftoverSV 1.0.0_beta #
# liftoverSV 0.1.1_beta #
# #
# Copyright (C) 2024-current Veronique Geoffroy ([email protected]) #
# #
Expand Down Expand Up @@ -210,7 +210,7 @@ proc writeTheLiftedVCF {} {
regsub "(^END|;END)=(\[^;\]+)(;|$)" $infos "\\1=$theNewEND\\3" infos
set svlen [expr {$end-$start}]
set svlenlifted [expr {$theNewEND-$theNewStart}]
if {$svlenlifted < [expr {$svlen*0.95}] || $svlenlifted > [expr {$svlen*1.05}]} {
if {$svlenlifted < [expr {$svlen*(1-$g_liftoverSV(PERCENT))}] || $svlenlifted > [expr {$svlen*(1+$g_liftoverSV(PERCENT))}]} {
# Case4
lappend L_unmappedToWrite "[join [lrange $Ls 0 7] "\t"]\tthe distance between the two lifted positions changes significantly (svlen diff > 5%)"
incr j
Expand Down Expand Up @@ -248,7 +248,7 @@ proc writeTheLiftedVCF {} {
regsub "(^SVEND|;SVEND)=(\[^;\]+)(;|$)" $infos "\\1=$theNewSVEND\\3" infos
set svlen [expr {$svend-$start}]
set svlenlifted [expr {$theNewSVEND-$theNewStart}]
if {$svlenlifted < [expr {$svlen*0.95}] || $svlenlifted > [expr {$svlen*1.05}]} {
if {$svlenlifted < [expr {$svlen*(1-$g_liftoverSV(PERCENT))}] || $svlenlifted > [expr {$svlen*(1+$g_liftoverSV(PERCENT))}]} {
# Case4
lappend L_unmappedToWrite "[join [lrange $Ls 0 7] "\t"]\tthe distance between the two lifted positions changes significantly (svlen diff > 5%; $svlen # $svlenlifted)"
incr j
Expand Down

0 comments on commit 1734618

Please sign in to comment.