Commit 33f7ac87 authored by mcariou's avatar mcariou
Browse files

script 5 in progress, cat

parent 704f9ba5
......@@ -101,6 +101,7 @@ system(cmd)
library(ape)
aln<-read.dna(fasta, format="fasta")
aln<-clustal(aln)
names(listid_short)<-gsub(names(listid_short), pattern=" ", replacement="_")
......
......@@ -68,7 +68,6 @@ nrow=`cat $subblast | wc -l`
echo "sequences already retrieved"
else
echo "retrieve fasta"
#Rscript --vanilla $rscript $subblast $EVAL $PERCID $PERCOVERLAP $NPERTAX $FASTA> $FASTA_REP/$Gene/paste_blast_test.log
Rscript --vanilla $rscript $subblast $EVAL $PERCID $PERCOVERLAP $NPERTAX $FASTA $BLASTDBNUC $TAXO > $FASTA_REP/$Gene/paste_blast_test.log
fi ;
......
#!/usr/bin/env Rscript
args = commandArgs(trailingOnly=TRUE)
# test if there is at least one argument: if not, return an error
if (length(args)!=1) {
stop("1 arguments must be supplied.\n", call.=FALSE)
}
#args<-c("/home/mcariou/2021_legio/fasta/78Lp", "~/2020_Attaiech/prot_db/Transdecoder", "~/2021_legio/phylolegio/doc/tabAss.txt")
#args<-c("/home/mcariou/2021_legio/fasta/78Lp")
subrep<-list.files(args[1])
subrep<-subrep[grep(x=subrep, pattern="Q5")]
#### Change names in the fasta
library(ape)
cat<-list()
#### fuction
file<-list.files(paste0(args[1], "/", subrep[1]))
file<-file[grep(x=file, pattern="aln")]
aln<-read.dna(paste0(args[1], "/",subrep[1], "/", file), format="fasta", as.character=TRUE)
tmp<-aln
names(tmp)<-sapply(labels(aln), function(x) strsplit(x, split=".", fixed=TRUE)[[1]][1])
for (seq in names(tmp)){
print(seq)
cat<-c(cat, list(seq=tmp[seq]))
names(cat)<-c(names(cat)[-length(cat)], seq)
}
#write.dna(aln, file=fasta_aln, format="fasta", nbcol = 6, colsep = "", colw = 10)
#!/bin/bash
echo "USAGE: ./5_aln_phy.sh \$1=fasta_path"
echo "--------------------------------------------------"
##################################################################################################################
### En local
#./5_aln_phy.sh ~/Documents/CIRI_BIBS_projects/2021_04_Doublet/pipeline/fasta/ lp0952_ortho
### PSMN
#./5_cat_aln_phy.sh ~/2021_legio/fasta/78Lp/
##################################################################################################################
# variable
DATA=$1
FASTA=$1/concat.fasta
PHYLIP=$1/concat.phylip
echo $0
rscript=`ls $0 | sed 's/.sh/.R/g'`
echo $rscript
if [[ -s $FASTA ]] ; then
echo "sequences already concatenated"
else
echo "concatenate fasta"
Rscript --vanilla $rscript $DATA > $DATA/cat.log
fi ;
if [ -e $FASTA ] ; then
echo $FASTA" exists"
#prank -d=$FASTA +F -o=$ALN
echo $ALN
## Convert to phylipX
trimal -in $FASTA -out $PHYLIP -phylip
## phylogeny
phyml -i $PHYLIP -d nt -m HKY85 -a e -c 4 -s NNI -b -1
else
echo $FASTA "do not exists. incorrect input"
fi ;
# fin
Supports Markdown
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