|
| 1 | + |
| 2 | +# Predict repeats [EDTA] |
| 3 | + |
| 4 | +EDTA.pl \ |
| 5 | +--genome $asm \ |
| 6 | +--cds $cds \ |
| 7 | +--sensitive 1 \ |
| 8 | +--anno 1 \ |
| 9 | +--evaluate 1 \ |
| 10 | +--threads $threads |
| 11 | + |
| 12 | +# Transfer gene models from reference [liftoff] |
| 13 | + |
| 14 | +## csv input contains reference genome fasta; gff name; reference gff |
| 15 | +while IFS=, read ref gff_name ref_gff extra_params; do |
| 16 | +ref_name=$(basename -s .fa $ref) |
| 17 | +extra_params_expanded=$(eval "echo ${extra_params}") |
| 18 | +liftoff \ |
| 19 | +-p $threads \ |
| 20 | +$extra_params_expanded \ |
| 21 | +-chroms $in_dir/$ref_name.chroms.txt \ |
| 22 | +$asm \ |
| 23 | +$ref \ |
| 24 | +-g $ref_gff \ |
| 25 | +-o $out_dir/$asm_name."$gff_name"_liftoff.gff3 \ |
| 26 | +-u $out_dir/$asm_name."$gff_name"_liftoff_unmapped.txt \ |
| 27 | +-dir $out_dir/"$gff_name"_intermediate_files |
| 28 | +# rename polished gff |
| 29 | +mv $out_dir/$asm_name."$gff_name"_liftoff.gff3_polished \ |
| 30 | +$out_dir/$asm_name."$gff_name"_liftoff_polished.gff3 |
| 31 | +done < $csv |
| 32 | + |
| 33 | +# Map short-read transcriptomes [STAR] |
| 34 | + |
| 35 | +for set in $(basename -a $reads_dir/*.fq.gz | cut -d_ -f1 | uniq) |
| 36 | +do |
| 37 | +mkdir $out_dir/$set |
| 38 | +STAR \ |
| 39 | +--runMode alignReads \ |
| 40 | +--runThreadN $threads \ |
| 41 | +--readFilesIn $reads_dir/"$set"_1.fq.gz $reads_dir/"$set"_2.fq.gz \ |
| 42 | +--genomeDir $asm_dir \ |
| 43 | +--readFilesCommand zcat \ |
| 44 | +--outFileNamePrefix $out_dir/$set/ \ |
| 45 | +--outSAMstrandField intronMotif \ |
| 46 | +--outSAMattributes All \ |
| 47 | +--outSAMattrIHstart 0 \ |
| 48 | +--outSAMtype BAM SortedByCoordinate \ |
| 49 | +--limitBAMsortRAM 100000000000 |
| 50 | +done |
| 51 | + |
| 52 | +# Assembly transcripts from shor-read mappings |
| 53 | + |
| 54 | +for set in $illumina_mappings/*/ |
| 55 | +do |
| 56 | + set_name=$(basename $set) |
| 57 | + stringtie \ |
| 58 | + $set/Aligned.sortedByCoord.out.bam \ |
| 59 | + -o $out_dir/$set_name.gtf \ |
| 60 | + -p $threads\ |
| 61 | + --rf \ |
| 62 | + -l STRG-$set_name |
| 63 | +done |
| 64 | + |
| 65 | +# Map iso-seq reads [minimap2] |
| 66 | + |
| 67 | +for set_dir in $isoseq_data/*/ |
| 68 | +do |
| 69 | + set_name=$(basename $set_dir) |
| 70 | + mkdir $out_base/$asm_name/$set_name |
| 71 | + for reads in $set_dir/*.fq.gz |
| 72 | + do |
| 73 | + reads_name=$(basename -s .fq.gz $reads) |
| 74 | + minimap2 \ |
| 75 | + -ax splice:hq -uf \ |
| 76 | + -G 5k \ |
| 77 | + --junc-bed $junc \ |
| 78 | + -t $threads \ |
| 79 | + $asm \ |
| 80 | + $reads | \ |
| 81 | + samtools sort -@ $threads \ |
| 82 | + -o $out_base/$asm_name/$set_name/$reads_name.bam |
| 83 | + done |
| 84 | + # merge samples by set |
| 85 | + samtools merge \ |
| 86 | + $out_base/$asm_name/$set_name.merged.bam \ |
| 87 | + $out_base/$asm_name/$set_name/*.bam |
| 88 | + # index merged set bams |
| 89 | + samtools index $out_base/$asm_name/$set_name.merged.bam |
| 90 | +done |
| 91 | +conda deactivate |
| 92 | + |
| 93 | +# Collapse redundant iso-seq transcripts [tama-collapse] |
| 94 | + |
| 95 | + for bam in $isoseq_mappings/*.merged.bam |
| 96 | + do |
| 97 | + bam_name=$(basename -s .merged.bam $bam) |
| 98 | + python tama_collapse.py \ |
| 99 | + -b BAM -s $bam \ |
| 100 | + -f $asm \ |
| 101 | + -p $out_dir/$bam_name \ |
| 102 | + -x no_cap |
| 103 | + done |
| 104 | +conda deactivate |
| 105 | + |
| 106 | +# Validate junctions and filter mappings [portcullis] |
| 107 | + |
| 108 | +portcullis full \ |
| 109 | +-t $threads \ |
| 110 | +$asm \ |
| 111 | +--output $out_dir \ |
| 112 | +--bam_filter \ |
| 113 | +$illumina_mappings/*/Aligned.sortedByCoord.out.bam |
| 114 | + |
| 115 | +# Predict transcripts with braker [BRAKER3] |
| 116 | + |
| 117 | +braker.pl \ |
| 118 | +--genome=$masked_asm \ |
| 119 | +--prot_seq=$prot \ |
| 120 | +--bam=$bams \ |
| 121 | +--workingdir=$out_dir \ |
| 122 | +--threads $threads \ |
| 123 | +--busco_lineage solanales_odb10 &> \ |
| 124 | +$out_dir/braker_run.log |
| 125 | + |
| 126 | +# Choose best trabscripts [mikado] |
| 127 | + |
| 128 | +## 1 CONFIGURE |
| 129 | +mikado configure \ |
| 130 | +--list $out_dir/inputs.txt \ |
| 131 | +--reference $asm \ |
| 132 | +--mode permissive \ |
| 133 | +--check-references \ |
| 134 | +--scoring plant.yaml \ |
| 135 | +--copy-scoring $out_dir/plant.yaml \ |
| 136 | +--threads $threads \ |
| 137 | +--out-dir $out_dir \ |
| 138 | +--junctions $junc \ |
| 139 | +--blast_targets $prot \ |
| 140 | +$out_dir/configuration.yaml |
| 141 | + |
| 142 | +## 2 PREPARE |
| 143 | +mikado prepare \ |
| 144 | +--procs $threads \ |
| 145 | +--json-conf $out_dir/configuration.yaml |
| 146 | + |
| 147 | +## 3 BLAST |
| 148 | +makeblastdb \ |
| 149 | +-in $out_dir/blast/$prot_name.fa \ |
| 150 | +-dbtype prot -parse_seqids > \ |
| 151 | +$out_dir/blast/"$prot_name"_prepare.log |
| 152 | + |
| 153 | +blastx -max_target_seqs 5 \ |
| 154 | +-outfmt "6 qseqid sseqid pident length mismatch gapopen qstart qend sstart send evalue bitscore ppos btop" \ |
| 155 | +-num_threads $threads \ |
| 156 | +-query $out_dir/mikado_prepared.fasta \ |
| 157 | +-db $out_dir/blast/$prot_name.fa \ |
| 158 | +-out $out_dir/mikado_prepared.blast.tsv |
| 159 | + |
| 160 | +## 4 ORF predictions [transdecoder] |
| 161 | +TransDecoder.LongOrfs \ |
| 162 | +-t $out_dir/mikado_prepared.fasta \ |
| 163 | +--output_dir $out_dir |
| 164 | + |
| 165 | +TransDecoder.Predict \ |
| 166 | +-t $out_dir/mikado_prepared.fasta \ |
| 167 | +--output_dir $out_dir |
| 168 | + |
| 169 | +## 5 SERIALZE |
| 170 | +mikado serialise \ |
| 171 | +--procs $threads \ |
| 172 | +--json-conf $out_dir/configuration.yaml \ |
| 173 | +--orfs $out_dir/mikado_prepared.fasta.transdecoder.bed \ |
| 174 | +--tsv $out_dir/mikado_prepared.blast.tsv \ |
| 175 | +--blast_targets $out_dir/blast/uniprot_plants_simple_prefix.fa |
| 176 | + |
| 177 | +## 6 PICK |
| 178 | +mikado pick \ |
| 179 | +--procs $threads \ |
| 180 | +--configuration $out_dir/configuration_$version.yaml \ |
| 181 | +--subloci-out $out_dir/mikado.subloci.gff3 |
| 182 | + |
| 183 | +# Functional annotation [emapper] |
| 184 | + |
| 185 | +emapper.py \ |
| 186 | +-m diamond \ |
| 187 | +--data_dir $data_dir \ |
| 188 | +-i $prot \ |
| 189 | +--dbmem \ |
| 190 | +--decorate_gff $in_gff \ |
| 191 | +--decorate_gff_ID_field ID \ |
| 192 | +--cpu $threads \ |
| 193 | +-o $asm_name.$version \ |
| 194 | +--output_dir $out_dir \ |
| 195 | +--tax_scope 33090 > $out_dir/run.log 2>&1 |
| 196 | + |
0 commit comments