Skip to content

Commit

Permalink
Merge pull request #50 from tyler5huang/master
Browse files Browse the repository at this point in the history
SMuRFv2.0.6
  • Loading branch information
tyler5huang authored Nov 18, 2020
2 parents c391d5d + 14f42f2 commit bce10eb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
23 changes: 12 additions & 11 deletions smurf/R/parsevcf_allfeaturesall.R
Original file line number Diff line number Diff line change
Expand Up @@ -327,19 +327,19 @@ parsevcf_allfeaturesall = function(x, tbi, roi=F, roi.dir=NULL, t.label=NULL){
meta_data=data.frame(snv_pass)[,1:3]
meta_data[c(names_m2,names_f,names_vs,names_vd,names_s2)]=NA
#do not merge when the 1st row is all NAs + last column PASSED/REJECT
if ((rowSums(is.na(data.frame(mcols(gr_m2)[1,1:length(mcols(gr_m2))-1])))!=ncol(data.frame(mcols(gr_m2)[1,-1]))-1)==TRUE) {
if ((rowSums(is.na(data.frame(mcols(gr_m2)[1,1:length(mcols(gr_m2))-1])))!=ncol(data.frame(mcols(gr_m2)[1,1:length(mcols(gr_m2))-1])))==TRUE) {
meta_data[Biostrings::match(gr_m2, snv_pass), names_m2]=data.frame(mcols(gr_m2)[,-1])
}
if ((rowSums(is.na(data.frame(mcols(gr_f)[1,1:length(mcols(gr_f))-1])))!=ncol(data.frame(mcols(gr_f)[1,-1]))-1)==TRUE) {
if ((rowSums(is.na(data.frame(mcols(gr_f)[1,1:length(mcols(gr_f))-1])))!=ncol(data.frame(mcols(gr_f)[1,1:length(mcols(gr_f))-1])))==TRUE) {
meta_data[Biostrings::match(gr_f, snv_pass), names_f]=data.frame(mcols(gr_f)[,-1])
}
if ((rowSums(is.na(data.frame(mcols(gr_vs)[1,1:length(mcols(gr_vs))-1])))!=ncol(data.frame(mcols(gr_vs)[1,-1]))-1)==TRUE) {
if ((rowSums(is.na(data.frame(mcols(gr_vs)[1,1:length(mcols(gr_vs))-1])))!=ncol(data.frame(mcols(gr_vs)[1,1:length(mcols(gr_vs))-1])))==TRUE) {
meta_data[Biostrings::match(gr_vs, snv_pass), names_vs]=data.frame(mcols(gr_vs)[,-1])
}
if ((rowSums(is.na(data.frame(mcols(gr_vd)[1,1:length(mcols(gr_vd))-1])))!=ncol(data.frame(mcols(gr_vd)[1,-1]))-1)==TRUE) {
if ((rowSums(is.na(data.frame(mcols(gr_vd)[1,1:length(mcols(gr_vd))-1])))!=ncol(data.frame(mcols(gr_vd)[1,1:length(mcols(gr_vd))-1])))==TRUE) {
meta_data[Biostrings::match(gr_vd, snv_pass), names_vd]=data.frame(mcols(gr_vd)[,-1])
}
if ((rowSums(is.na(data.frame(mcols(gr_s2)[1,1:length(mcols(gr_s2))-1])))!=ncol(data.frame(mcols(gr_s2)[1,-1]))-1)==TRUE) {
if ((rowSums(is.na(data.frame(mcols(gr_s2)[1,1:length(mcols(gr_s2))-1])))!=ncol(data.frame(mcols(gr_s2)[1,1:length(mcols(gr_s2))-1])))==TRUE) {
meta_data[Biostrings::match(gr_s2, snv_pass), names_s2]=data.frame(mcols(gr_s2)[,-1])
}

Expand Down Expand Up @@ -833,22 +833,23 @@ parsevcf_allfeaturesall = function(x, tbi, roi=F, roi.dir=NULL, t.label=NULL){
meta_indel=data.frame(indel_pass)[,1:3]
meta_indel[c(names_m2,names_f,names_vs,names_vd,names_s2)]=NA
#do not merge when the 1st row is all NAs + last column PASSED/REJECT
if ((rowSums(is.na(data.frame(mcols(gr_m2)[1,1:length(mcols(gr_m2))-1])))!=ncol(data.frame(mcols(gr_m2)[1,-1]))-1)==TRUE) {
if ((rowSums(is.na(data.frame(mcols(gr_m2)[1,1:length(mcols(gr_m2))-1])))!=ncol(data.frame(mcols(gr_m2)[1,1:length(mcols(gr_m2))-1])))==TRUE) {
meta_indel[Biostrings::match(gr_m2, indel_pass), names_m2]=data.frame(mcols(gr_m2)[,-1])
}
if ((rowSums(is.na(data.frame(mcols(gr_f)[1,1:length(mcols(gr_f))-1])))!=ncol(data.frame(mcols(gr_f)[1,-1]))-1)==TRUE) {
if ((rowSums(is.na(data.frame(mcols(gr_f)[1,1:length(mcols(gr_f))-1])))!=ncol(data.frame(mcols(gr_f)[1,1:length(mcols(gr_f))-1])))==TRUE) {
meta_indel[Biostrings::match(gr_f, indel_pass), names_f]=data.frame(mcols(gr_f)[,-1])
}
if ((rowSums(is.na(data.frame(mcols(gr_vs)[1,1:length(mcols(gr_vs))-1])))!=ncol(data.frame(mcols(gr_vs)[1,-1]))-1)==TRUE) {
if ((rowSums(is.na(data.frame(mcols(gr_vs)[1,1:length(mcols(gr_vs))-1])))!=ncol(data.frame(mcols(gr_vs)[1,1:length(mcols(gr_vs))-1])))==TRUE) {
meta_indel[Biostrings::match(gr_vs, indel_pass), names_vs]=data.frame(mcols(gr_vs)[,-1])
}
if ((rowSums(is.na(data.frame(mcols(gr_vd)[1,1:length(mcols(gr_vd))-1])))!=ncol(data.frame(mcols(gr_vd)[1,-1]))-1)==TRUE) {
if ((rowSums(is.na(data.frame(mcols(gr_vd)[1,1:length(mcols(gr_vd))-1])))!=ncol(data.frame(mcols(gr_vd)[1,1:length(mcols(gr_vd))-1])))==TRUE) {
meta_indel[Biostrings::match(gr_vd, indel_pass), names_vd]=data.frame(mcols(gr_vd)[,-1])
}
if ((rowSums(is.na(data.frame(mcols(gr_s2)[1,1:length(mcols(gr_s2))-1])))!=ncol(data.frame(mcols(gr_s2)[1,-1]))-1)==TRUE) {
if ((rowSums(is.na(data.frame(mcols(gr_s2)[1,1:length(mcols(gr_s2))-1])))!=ncol(data.frame(mcols(gr_s2)[1,1:length(mcols(gr_s2))-1])))==TRUE) {
meta_indel[Biostrings::match(gr_s2, indel_pass), names_s2]=data.frame(mcols(gr_s2)[,-1])
}



end.time=Sys.time()
print(end.time-start.time)

Expand Down
2 changes: 1 addition & 1 deletion smurf/R/smurf.R
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ smurf = function(directory=NULL, mode=NULL, nthreads = -1,
check.packages=T, file.exclude=NULL){

#SMuRF version announcement
print("SMuRFv2.0.5 (2nd Nov 2020)")
print("SMuRFv2.0.6 (18th Nov 2020)")


if(is.null(directory)){
Expand Down

0 comments on commit bce10eb

Please sign in to comment.