Genomic scripts repository

Image credit: Heng Chen

Overview

This repository contains customized scripts used for genomic research. See GitHub for more details.

Gene

  • Chr_id.py - Extracts unique chromosome or sequence IDs from the first column of a GFF3 file.
  • correct_proteome.py - Cleans protein FASTA files before DIAMOND analysis by replacing invalid amino-acid characters with X.
  • delete_mRNA.py - Removes selected transcript models from a GFF3 annotation and writes updated and deleted gene/transcript records.
  • diamond_all_gene_homolog.py - Runs DIAMOND protein searches between target and reference proteomes and produces a gene-level homolog table.
  • diamond_rescue_target_na_gene.py - Performs a second-direction DIAMOND rescue for target genes that remain unmatched after coordinate and reference-side rescue steps.
  • diamond_rescue_unmatched_gene.py - Uses DIAMOND to rescue unmatched reference or target genes and add sequence-supported homolog assignments.
  • final_homolog.py - Combines coordinate-based and DIAMOND-supported evidence into a final homolog table between two species.
  • gff3_to_bed.py - Converts repeat_region features from GFF3 into BED format with 0-based starts.
  • gff3_to_bed4.py - Converts GFF3 features into BED4 format, including feature IDs as the fourth BED column.
  • identify_homology.py - Identifies homologous genes by comparing gene coordinates and annotations between species.
  • one_step_homology_with_default.py - Runs the homolog-identification workflow with default filtering and rescue settings.
  • rename_gff.py - Renames genes, mRNAs, exons, CDS, and UTR features in a GFF3 file using sequence-name prefixes.
  • separate_non_overlapping_trans.py - Splits non-overlapping isoforms into separate gene entries or reassigns them to overlapping genes.
  • transcript_lengths_from_gff3.py - Calculates spliced transcript length, unspliced transcript span, CDS length, and exon/CDS counts from GFF3 annotations.

Genome

  • chr_length.py - Generates a sorted chromosome-length file from a genome FASTA for use with BEDTools.
  • Gene_TE_distance_density.R - Plots density curves of distances between TEs and their nearest genes across species.
  • Gene_TE_distance_density_dashed_line.R - Produces the same TE-nearest-gene distance density plot using dashed lines.
  • genome_statistic.pl - Calculates genome assembly statistics, including genome size, GC/N content, gap number, scaffold/contig N50 and N90, and L50/L90.

TE

  • add_chr_id.py - Adds sequential chromosome IDs to a list of chromosome or scaffold names.
  • BLASTN.sh - Builds a nucleotide BLAST database from an organelle reference and compares TE libraries against it.
  • check_TE_classification.py - Looks up TE classifications for a list of TE IDs using an annotation GFF3 file.
  • chr_name_short_raw.txt - Mapping table between shortened chromosome/scaffold names and original raw sequence names.
  • DeepTE_name.txt - Mapping table from DeepTE class labels to the TE classification names used in this project.
  • detect_non_TE_RNA_by_Pfam.py - Detects RNA-derived entries in a TE library from Rfam/Infernal results and splits RNA from non-RNA sequences.
  • detect_satellite_by_tantan.py - Uses tantan output to identify simple-repeat or satellite-like sequences in a TE library.
  • extract_organelle_scaffolds.py - Extracts scaffolds or regions likely derived from organelle sequences based on BLAST-like evidence.
  • extract_TE_annotation.py - Extracts selected TE annotation records from GFF3 files.
  • FASTA_chr_name.py - Extracts FASTA header names into a text file.
  • FASTA_chr_name_change.py - Renames FASTA sequence headers using a two-column name mapping file.
  • gff_chr_name_change.py - Renames the sequence ID column of a GFF3 file using a mapping table.
  • rename_TR_gff.py - Renames tandem-repeat GFF3 records into the TE naming format used by the project.
  • rmout_to_bed4.py - Converts RepeatMasker .out records into BED4 format.
  • sort_and_rename_TE_lib.py - Sorts TE library sequences by class/family/group and assigns standardized TE IDs.
  • split_TE_class_or_family_unknown_lib_for_DeepTE.py - Extracts TE library entries with unknown class or family labels for DeepTE classification.
  • split_TE_gff3.py - Splits TE annotation GFF3 records by classification group.
  • split_TE_lib.py - Splits a TE library FASTA into separate files by TE class or family.
  • split_TE_lib_for_DeepTE.py - Prepares class-specific TE library subsets for DeepTE analysis.
  • TE_class_name.txt - Classification-order and prefix mapping table used for standardized TE library renaming.
  • TE_length.py - Calculates length and classification information for top-level TE annotations in GFF3 format.
  • TE_lib_stat.py - Summarizes sequence counts and total lengths for TE library classes.
  • update_DeepTE_lib.py - Updates TE library headers using DeepTE classifications while preserving original labels when classifications conflict.
  • update_stat_EDTA_anno.py - Cleans EDTA GFF3 annotations and calculates TE counts and masked base pairs at class, family, clade, and sequence levels.
  • update_TEsorter_lib.py - Resolves and cleans TEsorter FASTA headers, choosing the most informative non-unknown classification when possible.

Heng Chen
Heng Chen
DPhil Student

My heart will go on.