From df87f670afdf4cc236b927cc0602349cf544151d Mon Sep 17 00:00:00 2001
From: Laurent Modolo <laurent@modolo.fr>
Date: Mon, 8 Oct 2018 16:53:20 +0200
Subject: [PATCH] intersect_SNP.R: sort results by AF

---
 src/intersect_SNP.R | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/intersect_SNP.R b/src/intersect_SNP.R
index 6cd39fb2..b2f7df28 100755
--- a/src/intersect_SNP.R
+++ b/src/intersect_SNP.R
@@ -17,7 +17,7 @@ snp <- snp_b %>%
   filter(cords %in% only_b)
 
 fastafile <- read.fasta(file = args[3],
-                        as.string = TRUE) 
+                        as.string = TRUE)
 
 snp$seq_list <- snp %>%
   apply(1, FUN = function(x, fastafile, POS, CHROM){
@@ -38,5 +38,6 @@ snp$seq_list <- snp %>%
   )
 
 snp %>%
+  arrange(desc(tumor_sample.AF)) %>%
   write_csv(paste0("only_", args[2]))
 
-- 
GitLab