damiendevienne / phylter

Detection of outlier genes and species in phylogenomics
https://damiendevienne.github.io/phylter
9 stars 5 forks source link

pruned tree directory empty #9

Open MareikeJaniak opened 2 months ago

MareikeJaniak commented 2 months ago

Hi!

Thanks for this great new tool, I'm currently exploring it.

I'm running into an issue with the tree pruning step when using the docker image. When running the command with -p TRUE, the output seems normal but no pruned trees are output :

Total number of outliers detected: 873
Number of complete gene outliers : 0
Number of complete species outliers : 0

Gain (concordance between matrices): 2.35%
Loss (data filtering): 0.26%
PhylteR is done - 2024-08-20 21:36:13

Starting tree pruning step

Tree pruning command used = prune_tree_outliers.R Esselstyn_output Inputs/IndividualTrees Esselstyn_output/phylter.out

[1] "Starting tree pruning step"

Trees have been pruned - 2024-08-20 21:36:14

Everything is done - 2024-08-20 21:36:14

When trying to run the pruning step separately, the following error occurs:

docker run -v $PWD:$PWD -w $PWD treecoutheo/phylter_docker prune_tree_outliers.R Outputs Inputs/IndividualTrees Esselstyn_output/phylter.out 
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
[1] "Starting tree pruning step"
Error in if (file == "") file <- stdin() else { : 
  the condition has length > 1
Calls: by ... lapply -> FUN -> FUN -> prunetree -> read.tree -> scan
Execution halted

Is it possible to share the commands used in prune_tree_outliers.R, so I can run them directly in R? Is it just a loop that drops the outlier tips from the respective trees?

Thanks for your help!

Best, Mareike

theotricou commented 2 months ago

Hello Mareike,

I'm looking into the problem. It seems that something has changed in the way PhylteR formats the outlier file. Just to be sure, could you share your outliers file ? (or at least the 100 first lines if your file is to big).

Best, Theo

MareikeJaniak commented 2 months ago

Hi Theo,

Sure thing! Here it is: phylter_R_output.txt

I ended up writing a little loop to prune the trees in R, based on the code you published along with the paper:

PHY <- results$Final$Outliers
k <- unique(PHY[,1])

prunedTrees <- trees
for (i in 1:length(trees)) {
  if (i %in% k) {
    tips2remove<-PHY[PHY[,1]==i,2]
    prunedTrees[[i]] <- drop.tip(trees[[i]], tips2remove)
  }
}

Best, Mareike