20251125
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use File::Basename;
|
||||
|
||||
my $usage = "usage: $0 bams.list\n\n";
|
||||
|
||||
my $bam_list_file = $ARGV[0] or die $usage;
|
||||
|
||||
open (my $fh, $bam_list_file) or die $!;
|
||||
while (<$fh>) {
|
||||
chomp;
|
||||
my $bam_file = $_;
|
||||
|
||||
my $base_dir = dirname($bam_file);
|
||||
|
||||
my $cmd = "cufflinks -o $base_dir/ $bam_file";
|
||||
|
||||
print "$cmd\n";
|
||||
}
|
||||
|
||||
exit(0);
|
||||
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
my $usage = "usage: $0 cuff_gtf.list\n\n";
|
||||
|
||||
my $trans_gtf_files = $ARGV[0] or die $usage;
|
||||
|
||||
main: {
|
||||
|
||||
open (my $fh, $trans_gtf_files) or die $!;
|
||||
|
||||
while (<$fh>) {
|
||||
chomp;
|
||||
my $filename = $_;
|
||||
|
||||
my $cmd = "cufflinks_gtf_to_bed.pl $filename > $filename.bed";
|
||||
|
||||
print "$cmd\n";
|
||||
}
|
||||
|
||||
close $fh;
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
my $usage = "usage: $0 gene_gff3.list\n\n";
|
||||
|
||||
my $gene_gff3_files = $ARGV[0] or die $usage;
|
||||
|
||||
main: {
|
||||
|
||||
open (my $fh, $gene_gff3_files) or die $!;
|
||||
|
||||
while (<$fh>) {
|
||||
chomp;
|
||||
my $filename = $_;
|
||||
|
||||
my $cmd = "gene_gff3_to_bed.pl $filename > $filename.bed";
|
||||
|
||||
print "$cmd\n";
|
||||
}
|
||||
|
||||
close $fh;
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
#!/usr/bin/env perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use File::Basename;
|
||||
use Cwd;
|
||||
|
||||
my $usage = "usage: $0 trin_fa.list\n\n";
|
||||
|
||||
my $trin_fa_files = $ARGV[0] or die $usage;
|
||||
|
||||
my $workdir = cwd();
|
||||
|
||||
|
||||
open (my $fh, $trin_fa_files) or die "Error, cannot open file $trin_fa_files";
|
||||
while (<$fh>) {
|
||||
chomp;
|
||||
my $trin_fa_file = $_;
|
||||
|
||||
my $outdir = dirname($trin_fa_file);
|
||||
|
||||
my $cmd = "gmap -g $outdir/gene.fa $trin_fa_file -f 3 > $trin_fa_file.gff3";
|
||||
|
||||
|
||||
#&process_cmd($cmd);
|
||||
print "$cmd\n";
|
||||
|
||||
}
|
||||
exit(0);
|
||||
|
||||
|
||||
####
|
||||
sub process_cmd {
|
||||
my ($cmd) = @_;
|
||||
|
||||
print STDERR "CMD: $cmd\n";
|
||||
my $ret = system($cmd);
|
||||
if ($ret) {
|
||||
die "Error, cmd: $cmd died with ret $ret";
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
## partition the genes
|
||||
~/GITHUB/trinityrnaseq/util/misc/genome_gff3_to_gene_gff3_partitions.pl genes.gff3 genes.fa 500
|
||||
find gene_contigs/ -regex ".*gene.fa" | tee fa_files.list
|
||||
|
||||
## simulate reads:
|
||||
sim_reads.pl fa_files.list | tee sim.cmds
|
||||
|
||||
|
||||
# Trinity
|
||||
~/GITHUB/trinityrnaseq/util/misc/iso_reco_analysis/run_trinity_no_LR.pl fa_files.list | tee trin.noFL.cmds
|
||||
|
||||
~/GITHUB/trinityrnaseq/util/misc/iso_reco_analysis/run_trinity_WITH_LR.pl ./fa_files.list | tee trin.withFL.cmds
|
||||
|
||||
# gmap the Trinity reconstructed transcripts to the gene sequence
|
||||
find gene_contigs/ -regex ".*Trinity.fasta" > trin_fa.list
|
||||
~/GITHUB/trinityrnaseq/util/misc/iso_reco_analysis/gmap_to_ref.pl trin_fa.list > gmap.cmds
|
||||
|
||||
# cufflinks reconstruct
|
||||
find gene_contigs/ -regex ".*genome.sam.coordSorted.bam" | tee bams.list
|
||||
~/GITHUB/trinityrnaseq/util/misc/iso_reco_analysis/bam_to_cuff.pl bams.list | tee cuff.cmds
|
||||
|
||||
# convert gff3 files to bed
|
||||
find gene_contigs/ -regex ".*gene.gff3" | tee gene.gff3.list
|
||||
~/GITHUB/trinityrnaseq/util/misc/iso_reco_analysis/gene_gff3_to_bed_cmds.pl gene.gff3.list > gene.gff3.list.cmds
|
||||
|
||||
# convert cuff gtf to bed:
|
||||
~/GITHUB/trinityrnaseq/util/misc/iso_reco_analysis/cuff_gtf_to_bed.pl cuff.list |tee cuff.list.cmds
|
||||
|
||||
|
||||
|
||||
########################################
|
||||
# pull together all results for viewing.
|
||||
|
||||
find bin_0/ -regex '.*gene.gff3.bed' -exec cat {} \; | sort -k1,1 -k2,2n > all_genes.gff3.bed
|
||||
|
||||
find bin_0 -regex ".*trinity_WITH_LR_outdir.Trinity.fasta.gff3.bed" -exec cat {} \; | sort -k1,1 -k2,2n > trin.WITH_LR.bed
|
||||
|
||||
find bin_0 -regex ".*trinity_no_LR_outdir.Trinity.fasta.gff3.bed" -exec cat {} \; | sort -k1,1 -k2,2n > trin.no_LR.bed
|
||||
|
||||
find bin_0 -regex ".*transcripts.gtf.bed" -exec cat {} \; | sort -k1,1 -k2,2n > cuff_trans.bed
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
#!/usr/bin/env perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use File::Basename;
|
||||
use Cwd;
|
||||
|
||||
my $usage = "usage: $0 genome_fa_files.list\n\n";
|
||||
|
||||
my $genome_fa_files = $ARGV[0] or die $usage;
|
||||
|
||||
my $workdir = cwd();
|
||||
|
||||
|
||||
open (my $fh, $genome_fa_files) or die "Error, cannot open file $genome_fa_files";
|
||||
while (<$fh>) {
|
||||
chomp;
|
||||
my $genome_file = $_;
|
||||
|
||||
my $outdir = dirname($genome_file);
|
||||
|
||||
if ($outdir !~ /^\./) {
|
||||
$outdir = "$workdir/$outdir";
|
||||
}
|
||||
|
||||
|
||||
my $cmd = "$ENV{TRINITY_HOME}/Trinity --seqType fa --single $outdir/simul.reads.fa --CPU 1 --max_memory 1G --output $outdir/trinity_WITH_LR_outdir --full_cleanup --long_reads $outdir/simul.transcriptome.cdnas --trinity_complete";
|
||||
|
||||
#&process_cmd($cmd);
|
||||
print "$cmd\n";
|
||||
|
||||
}
|
||||
exit(0);
|
||||
|
||||
|
||||
####
|
||||
sub process_cmd {
|
||||
my ($cmd) = @_;
|
||||
|
||||
print STDERR "CMD: $cmd\n";
|
||||
my $ret = system($cmd);
|
||||
if ($ret) {
|
||||
die "Error, cmd: $cmd died with ret $ret";
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
#!/usr/bin/env perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use File::Basename;
|
||||
|
||||
my $usage = "usage: $0 genome_fa_files.list\n\n";
|
||||
|
||||
my $genome_fa_files = $ARGV[0] or die $usage;
|
||||
|
||||
open (my $fh, $genome_fa_files) or die "Error, cannot open file $genome_fa_files";
|
||||
while (<$fh>) {
|
||||
chomp;
|
||||
my $genome_file = $_;
|
||||
|
||||
my $outdir = dirname($genome_file);
|
||||
|
||||
my $cmd = "$ENV{TRINITY_HOME}/Trinity --seqType fa --single $outdir/simul.reads.fa --CPU 1 --max_memory 1G --output $outdir/trinity_no_LR_outdir --full_cleanup --trinity_complete";
|
||||
|
||||
#&process_cmd($cmd);
|
||||
print "$cmd\n";
|
||||
|
||||
}
|
||||
exit(0);
|
||||
|
||||
|
||||
####
|
||||
sub process_cmd {
|
||||
my ($cmd) = @_;
|
||||
|
||||
print STDERR "CMD: $cmd\n";
|
||||
my $ret = system($cmd);
|
||||
if ($ret) {
|
||||
die "Error, cmd: $cmd died with ret $ret";
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
#!/usr/bin/env perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use File::Basename;
|
||||
|
||||
my $usage = "usage: $0 genome_fa_files.list\n\n";
|
||||
|
||||
my $genome_fa_files = $ARGV[0] or die $usage;
|
||||
|
||||
open (my $fh, $genome_fa_files) or die "Error, cannot open file $genome_fa_files";
|
||||
while (<$fh>) {
|
||||
chomp;
|
||||
my $genome_file = $_;
|
||||
|
||||
my $gff3_file = $genome_file;
|
||||
$gff3_file =~ s/\.fa$/\.gff3/;
|
||||
|
||||
my $outdir = dirname($gff3_file);
|
||||
|
||||
my $cmd = "$ENV{TRINITY_HOME}/util/misc/simulate_reads_sam_and_fa.pl --gff3 $gff3_file --genome $genome_file --frag_length 300 --read_length 76 --SS_lib_type F --out_prefix $outdir/simul";
|
||||
|
||||
#&process_cmd($cmd);
|
||||
print "$cmd\n";
|
||||
|
||||
}
|
||||
exit(0);
|
||||
|
||||
|
||||
####
|
||||
sub process_cmd {
|
||||
my ($cmd) = @_;
|
||||
|
||||
print STDERR "CMD: $cmd\n";
|
||||
my $ret = system($cmd);
|
||||
if ($ret) {
|
||||
die "Error, cmd: $cmd died with ret $ret";
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
my $usage = "usage: $0 trans_gff3.list\n\n";
|
||||
|
||||
my $trans_gff3_files = $ARGV[0] or die $usage;
|
||||
|
||||
main: {
|
||||
|
||||
open (my $fh, $trans_gff3_files) or die $!;
|
||||
|
||||
while (<$fh>) {
|
||||
chomp;
|
||||
my $filename = $_;
|
||||
|
||||
my $cmd = "transcript_gff3_to_bed.pl $filename > $filename.bed";
|
||||
|
||||
print "$cmd\n";
|
||||
}
|
||||
|
||||
close $fh;
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user