comparison scripts/format_transdecoder_headers.sh @ 1:3f862f346967 draft

planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit cf1b9c905931ca2ca25faa4844d45c908756472f-dirty
author abims-sbr
date Wed, 17 Jan 2018 09:02:12 -0500
parents f3600c96e961
children
comparison
equal deleted inserted replaced
0:f3600c96e961 1:3f862f346967
1 #/bin/bash 1 #/bin/bash
2 2
3 # v2 - this script modifies the 'Orthogroups.txt' file in order to make it easily readable by the following script, filter_orthofinder.py
4 #Example :
5 #OG0000001: Gene.117__As119_1/1_1.000_543__g.117__m.117 Gene.157__As170_1/1_1.000_1203__g.157__m.157
6 #Becomes :
7 #As119_1/1_1.000_543 As170_1/1_1.000_1203
8
9 # removes 'OGxxxxxxx: '
10 sed -E 's/OG[0-9]{7,}:\s//' $1 > $2
11 # removes things like Gene.119__
12 sed -i -E 's/Gene\.[0-9]{1,}\_\_/>/g' $2
13 # removes things like __g.117__m.117
14 sed -i -E 's/\_\_g\.[0-9]{1,}\_\_m\.[0-9]{1,}//g' $2
3 15
4 #This script contains regex to re-write the outputs of transdecoder to the original AdaptSearch format 16 # Old version
5 #Example :
6 #OG0007971: m.35 g.35 ORF g.35 m.35 type_internal len_307 _+_ Th132_1/1_1.000_923_1-924_+_
7 #Becomes :
8 #Th132_1/1_1.000_923
9 17
10 # removes 'OGxxxxxxx ' 18 # removes 'OGxxxxxxx '
11 sed -i -E 's/OG[0-9]{7}:\s//' $1 19 #sed -E 's/OG[0-9]{7}:\s//' $1 > $2
12 # replace _+_ by (+) because '_' causes bugs 20 # replace _+_ by (+) because '_' causes bugs
13 sed -i 's/_+_/(+)/g' $1 21 #sed -i 's/_+_/(+)/g' $2
14 # Replaces everything by '>' 22 # Replaces everything by '>'
15 sed -i -E 's/m\.[0-9]{1,}[^()]+\(\+\)\s*/>/g' $1 23 #sed -i -E 's/m\.[0-9]{1,}[^()]+\(\+\)\s*/>/g' $2
16 # Removes terminal '(+)' 24 # Removes terminal '(+)'
17 sed -i 's/(+)//g' $1 25 #sed -i 's/(+)//g' $2
18 # Removes last suite of unwanted numbers, underscore and dash 26 # Removes last suite of unwanted numbers, underscore and dash
19 sed -i -E 's/\_[0-9]{1,}-[0-9]{1,}//g' $1 27 #sed -i -E 's/\_[0-9]{1,}-[0-9]{1,}//g' $2