Skip to content

Latest commit

 

History

History
76 lines (51 loc) · 2.99 KB

README.md

File metadata and controls

76 lines (51 loc) · 2.99 KB

coordinates_conversion

Build Status

Conversion programs that use the output from fasta_diff to convert reference sequence IDs and coordinates in Gff3, bam, bed, or bedgraph file formats. Main contributors are Han Lin (original development) and interns of i5k workspace.

Prerequisite

  • Python 2.7
  • samtools (optional, only for SAM/BAM related scripts)

Installation

pip install git+https://github.com/NAL-i5K/coordinates_conversion.git

Features

Scripts to convert reference sequence IDs and coordinates in different file formats.

Quick start

  1. Run fasta_diff
  • Compares two very similar FASTA files and outputs coordinate mappings using a multi stage algorithm:

  • Stage 1: Find 100% matches

  • Stage 2: Find 100% substrings, where the full length of a new sequence can be found as a substring of a oldsequence

  • Stage 3: Find cases where part of the sequence was converted into Ns

  • Stage 4: Find cases where a old sequence is split into two or more new sequences

  • Outputs (match.tsv) the 6 columns as tab-separated values: old_id, old_start, old_end, new_id, new_start, new_end

    fasta_diff example_file/old.fa example_file/new.fa -o match.tsv -r report.txt

  1. Select a conversion script that matches your file format
  1. Run conversion script:
  • update_gff

    update_gff -a match.tsv example_file/example1.gff3 example_file/example2.gff3

  • update_bam

    • samtools needs to be installed before running this program:

    • If you have a bam file without a corresponding index file (.bai), you can generate one using:

      samtools index example_file/example.bam

    • Then use update_bam to convert your bam files

      update_bam -a match.tsv example_file/example.bam

    • update_bed

      update_bed -a match.tsv example_file/example.bed

    • update_bedgraph

      update_bedgraph -a match.tsv example_file/example.bedGraph

    • update_vcf

      update_vcf -a match.tsv example_file/example.vcf