Skip to content

Commit

Permalink
bug fix and prepare for the next version update
Browse files Browse the repository at this point in the history
  • Loading branch information
yjx1217 committed Jan 10, 2021
1 parent 529f4dc commit 5d7ad01
Show file tree
Hide file tree
Showing 5 changed files with 256 additions and 214 deletions.
61 changes: 41 additions & 20 deletions Project_Template/11.TE_Annotation/LRSDAY.11.TE_Annotation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,34 +39,55 @@ done

TY2_query="$LRSDAY_HOME/data/TY2_specific_region.fa"


db="$prefix.TY_REannotate.complete.TY1TY2.raw.fa"
db_tag="complete_TY1TY2_db"
$blast_dir/makeblastdb -in $db -dbtype nucl -title $db_tag -hash_index -out $db_tag
$blast_dir/blastn -task blastn -query $TY2_query -num_threads $threads -db $db_tag -outfmt 7 >$prefix.$db_tag.blastn.fmt7.out
perl $LRSDAY_HOME/scripts/filter_blast_result.pl -i $prefix.$db_tag.blastn.fmt7.out -pct_identity_cutoff 95 -aln_length_cutoff 500 -o $prefix.$db_tag.blastn.fmt7.I95L500.out
cat $prefix.$db_tag.blastn.fmt7.I95L500.out |egrep -v "^#" |cut -f 2 > $prefix.TY_REannotate.complete.TY2.list
comm -23 <(sort $prefix.TY_REannotate.complete.TY1TY2.raw.list) <(sort $prefix.TY_REannotate.complete.TY2.list) > $prefix.TY_REannotate.complete.TY1.list
cat $prefix.TY_REannotate.complete.TY1.list | sed "s/TY2/TY1/g" >$prefix.TY_REannotate.complete.TY1.final.list
cat $prefix.TY_REannotate.complete.TY2.list | sed "s/TY1/TY2/g" >$prefix.TY_REannotate.complete.TY2.final.list
if [ ! -s "$db" ]
then
echo "$db is empty, skip .."
touch $prefix.TY_REannotate.complete.TY1.final.list
touch $prefix.TY_REannotate.complete.TY2.final.list
else
$blast_dir/makeblastdb -in $db -dbtype nucl -title $db_tag -hash_index -out $db_tag
$blast_dir/blastn -task blastn -query $TY2_query -num_threads $threads -db $db_tag -outfmt 7 >$prefix.$db_tag.blastn.fmt7.out
perl $LRSDAY_HOME/scripts/filter_blast_result.pl -i $prefix.$db_tag.blastn.fmt7.out -pct_identity_cutoff 95 -aln_length_cutoff 500 -o $prefix.$db_tag.blastn.fmt7.I95L500.out
cat $prefix.$db_tag.blastn.fmt7.I95L500.out |egrep -v "^#" |cut -f 2 > $prefix.TY_REannotate.complete.TY2.list
comm -23 <(sort $prefix.TY_REannotate.complete.TY1TY2.raw.list) <(sort $prefix.TY_REannotate.complete.TY2.list) > $prefix.TY_REannotate.complete.TY1.list
cat $prefix.TY_REannotate.complete.TY1.list | sed "s/TY2/TY1/g" >$prefix.TY_REannotate.complete.TY1.final.list
cat $prefix.TY_REannotate.complete.TY2.list | sed "s/TY1/TY2/g" >$prefix.TY_REannotate.complete.TY2.final.list
fi

db="$prefix.TY_REannotate.truncated.TY1TY2.raw.fa"
db_tag="truncated_TY1TY2_db"
$blast_dir/makeblastdb -in $db -dbtype nucl -title $db_tag -hash_index -out $db_tag
$blast_dir/blastn -task blastn -query $TY2_query -num_threads $threads -db $db_tag -outfmt 7 >$prefix.$db_tag.blastn.fmt7.out
perl $LRSDAY_HOME/scripts/filter_blast_result.pl -i $prefix.$db_tag.blastn.fmt7.out -pct_identity_cutoff 95 -aln_length_cutoff 100 -o $prefix.$db_tag.blastn.fmt7.I95L100.out
cat $prefix.$db_tag.blastn.fmt7.I95L100.out |egrep -v "^#" |cut -f 2 > $prefix.TY_REannotate.truncated.TY2.list
comm -23 <(sort $prefix.TY_REannotate.truncated.TY1TY2.raw.list) <(sort $prefix.TY_REannotate.truncated.TY2.list) > $prefix.TY_REannotate.truncated.TY1.list
cat $prefix.TY_REannotate.truncated.TY1.list |sed "s/TY2/TY1/g" >$prefix.TY_REannotate.truncated.TY1.final.list
cat $prefix.TY_REannotate.truncated.TY2.list |sed "s/TY1/TY2/g" >$prefix.TY_REannotate.truncated.TY2.final.list
if [ ! -s "$db" ]
then
echo "$db is empty, skip .."
touch $prefix.TY_REannotate.truncated.TY1.final.list
touch $prefix.TY_REannotate.truncated.TY2.final.list
else
$blast_dir/makeblastdb -in $db -dbtype nucl -title $db_tag -hash_index -out $db_tag
$blast_dir/blastn -task blastn -query $TY2_query -num_threads $threads -db $db_tag -outfmt 7 >$prefix.$db_tag.blastn.fmt7.out
perl $LRSDAY_HOME/scripts/filter_blast_result.pl -i $prefix.$db_tag.blastn.fmt7.out -pct_identity_cutoff 95 -aln_length_cutoff 100 -o $prefix.$db_tag.blastn.fmt7.I95L100.out
cat $prefix.$db_tag.blastn.fmt7.I95L100.out |egrep -v "^#" |cut -f 2 > $prefix.TY_REannotate.truncated.TY2.list
comm -23 <(sort $prefix.TY_REannotate.truncated.TY1TY2.raw.list) <(sort $prefix.TY_REannotate.truncated.TY2.list) > $prefix.TY_REannotate.truncated.TY1.list
cat $prefix.TY_REannotate.truncated.TY1.list |sed "s/TY2/TY1/g" >$prefix.TY_REannotate.truncated.TY1.final.list
cat $prefix.TY_REannotate.truncated.TY2.list |sed "s/TY1/TY2/g" >$prefix.TY_REannotate.truncated.TY2.final.list
fi

db="$LRSDAY_HOME/data/TY_lib.Yue_et_al_2017_NG.LTRonly.fa"
db_tag="soloLTR_db";
LTR_query="$prefix.TY_REannotate.soloLTR.raw.fa"
$blast_dir/makeblastdb -in $db -dbtype nucl -title $db_tag -hash_index -out $db_tag
$blast_dir/blastn -task blastn -query $LTR_query -num_threads $threads -db $db_tag -outfmt 7 >$prefix.$db_tag.soloLTR.blastn.fmt7.out
perl $LRSDAY_HOME/scripts/trim_soloLTR_by_blast.pl -q $LTR_query -b $prefix.$db_tag.soloLTR.blastn.fmt7.out -p $prefix -i 70 -l 100
$bedtools_dir/bedtools sort -i $prefix.TY_REannotate.soloLTR.refined.gff > $prefix.TY_REannotate.soloLTR.refined.sorted.gff
perl $LRSDAY_HOME/scripts/rm_overlap_features_from_gff_simple.pl -r ./../genome.fa -i $prefix.TY_REannotate.soloLTR.refined.sorted.gff -o $prefix.TY_soloLTR.refined.nr.gff
if [ ! -s "$db" ]
then
echo "$db is empty, skip .."
touch $prefix.TY_soloLTR.refined.nr.gff
else
LTR_query="$prefix.TY_REannotate.soloLTR.raw.fa"
$blast_dir/makeblastdb -in $db -dbtype nucl -title $db_tag -hash_index -out $db_tag
$blast_dir/blastn -task blastn -query $LTR_query -num_threads $threads -db $db_tag -outfmt 7 >$prefix.$db_tag.soloLTR.blastn.fmt7.out
perl $LRSDAY_HOME/scripts/trim_soloLTR_by_blast.pl -q $LTR_query -b $prefix.$db_tag.soloLTR.blastn.fmt7.out -p $prefix -i 70 -l 100
$bedtools_dir/bedtools sort -i $prefix.TY_REannotate.soloLTR.refined.gff > $prefix.TY_REannotate.soloLTR.refined.sorted.gff
perl $LRSDAY_HOME/scripts/rm_overlap_features_from_gff_simple.pl -r ./../genome.fa -i $prefix.TY_REannotate.soloLTR.refined.sorted.gff -o $prefix.TY_soloLTR.refined.nr.gff
fi

for i in {1..5}
do
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ This protocol is designed for a desktop or computing server running an x86-64-bi
### Software or library requirements
* bash (https://www.gnu.org/software/bash/)
* bzip2 and libbz2-dev (http://www.bzip.org/)
* cmake (https://cmake.org/)
* cmake v3.2 or newer (https://cmake.org/)
* gcc and g++ v4.9.1 or newer (https://gcc.gnu.org/)
* ghostscript (https://www.ghostscript.com)
* git (https://git-scm.com/)
Expand Down
Loading

0 comments on commit 5d7ad01

Please sign in to comment.