Commit 3bcbf276 authored by Claire Hoede's avatar Claire Hoede
Browse files

RRBS

parent 7bdf1b93
......@@ -212,13 +212,13 @@ foreach my $window (keys(%h_windows)) {
# sans bedfile, avec RRBS OK
if ($bedfile eq "" and int($rrbs) == 1){
# Statistique de couverture en CG
$nbIntersect = `bedtools intersect -a $tmpDirectory/CG.bed -b $tmpDirectory/$window.bed | wc -l`;
$nbIntersect = `bedtools intersect -wa -a $tmpDirectory/CG.bed -b $tmpDirectory/$window.bed | wc -l`;
$pourcentCG = 0.0;
if ($nbIntersect != 0){
$pourcentCG = (int($nbIntersect) * 100.0) / $nb_CG;
printf OUTPUT ("$deb-$fin\t$h_windows{$window}[1]\t$h_windows{$window}[0]\t%.2f\t".int($nbIntersect)."\t%.2f\n", $pourcentCouv, $pourcentCG);
printf ("$deb-$fin\t$h_windows{$window}[1]\t$h_windows{$window}[0]\t%.2f\t".int($nbIntersect)."\t%.2f\n", $pourcentCouv, $pourcentCG);
}
}
# sans bedfile, sans RRBS OK
}elsif($bedfile eq "" and int($rrbs) == 0){
......@@ -228,14 +228,14 @@ foreach my $window (keys(%h_windows)) {
# avec bedfile, avec RRBS OK
}elsif($bedfile ne "" and int($rrbs) == 1){
# Statistique de couverture en CG
$nbIntersect = `bedtools intersect -a $tmpDirectory/CG.bed -b $tmpDirectory/$window.bed | wc -l`;
$nbIntersect = `bedtools intersect -wa -a $tmpDirectory/CG.bed -b $tmpDirectory/$window.bed | wc -l`;
$pourcentCG = 0.0;
if ($nbIntersect != 0){
$pourcentCG = (int($nbIntersect) * 100.0) / $nb_CG;
# Avec bedfile
$nb_candidat_bed = `bedtools sort -i $bedfile | uniq | wc -l`;
$listeIntersect = `bedtools intersect -a $bedfile -b $tmpDirectory/$window.bed > $outDirectory/intersection.out`;
$listeIntersect = `bedtools intersect -wa -a $bedfile -b $tmpDirectory/$window.bed > $outDirectory/intersection.out`;
$nbIntersectbed = `cat $outDirectory/intersection.out | wc -l`;
$pourcentbed = 0.0;
if (int($nb_candidat_bed) != 0){
......@@ -249,7 +249,7 @@ foreach my $window (keys(%h_windows)) {
}elsif($bedfile ne "" and int($rrbs) == 0){
# avec bedfile
$nb_candidat_bed = `bedtools sort -i $bedfile | uniq | wc -l`;
$listeIntersect = `bedtools intersect -a $bedfile -b $tmpDirectory/$window.bed > $outDirectory/intersection.out`;
$listeIntersect = `bedtools intersect -wa -a $bedfile -b $tmpDirectory/$window.bed > $outDirectory/intersection.out`;
$nbIntersectbed = `cat $outDirectory/intersection.out | wc -l`;
$pourcentbed = 0.0;
if (int($nb_candidat_bed) != 0){
......@@ -265,7 +265,7 @@ print("\n");
close(OUTPUT);
# Suppression de l'ensemble des fichiers temporaires
system "rm -rf $tmpDirectory";
#system "rm -rf $tmpDirectory";
########################################################################
# FONCTIONS #
......@@ -404,7 +404,7 @@ required :
-i[nfile reference genome (fasta)]
-p[refix (prefix for yours files)]
-d[igestion: enzyme digestion file]
Enzyme file format : MspI CCGG C*CGG
Enzyme file fo:wqat : MspI CCGG C*CGG
optionnal :
-w[indows-size: (ex: 100bp)]
......
......@@ -16,8 +16,13 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#
__author__ = 'Plateforme bioinformatique Midi Pyrenees'
__name__ = "insilicoRRBSdigestion.py"
__synopsis__ = "insilicoRRBSdigestion.py -i file.fa -o output_directory -c file.bed -j json | --enzyme --zero-based --double-selection --bins --min --max --bedtools"
__example__ = "python insilicoRRBSdigestion.py -i file.fa -o output_directory -c file.bed"
__date__ = "04/2016"
__authors__ = "Celine Noirot"
__keywords__ = "RRBS digestion"
__description__ = "The script simulates a complete enzymatic digestion of the genome to identify all the potential restriction fragments. Then, for each size range (from min to max fragment length of bins size ) it computes different metrics"
__copyright__ = 'Copyright (C) 2015 INRA'
__license__ = 'GNU General Public License'
__version__ = '1'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment