Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FragmentFinder

A command-line tool for identifying which DNA fragments are needed to assemble a target plasmid. Built for molecular biologists working with Golden Gate, Gibson, or other cloning methods.

What It Does

Given a list of candidate DNA fragments and a target plasmid sequence, FragmentFinder identifies:

  • Which fragments match the target (and where)
  • Which fragments are required for complete assembly
  • Subset fragments that are redundant (contained within larger fragments)
  • Coverage gaps if the fragments don't fully cover the target
  • Junction overlaps between adjacent fragments

Installation

# Clone the repository
git clone https://github.com/gvmfhy/fragmentfinder.git
cd fragmentfinder

# Install with pip
pip install -e .

Dependencies

  • Python 3.9+
  • pandas
  • biopython
  • click
  • mappy (minimap2 alignment)

Quick Start

# Basic analysis
fragmentfinder analyze your_fragments.csv

# Just get the required fragment names
fragmentfinder analyze your_fragments.csv --list-only

# With stricter identity threshold
fragmentfinder analyze your_fragments.csv --min-identity 0.95

Input Format

FragmentFinder accepts CSV or Excel files with:

Column A Column B
Fragment name DNA sequence
... ...
(blank row)
Target name Target plasmid sequence

Example fragments.csv:

Name,Sequence
Fragment_1,ATGCGATCGATCG...
Fragment_2,GCTAGCTAGCTAG...
Fragment_3,TAGCTAGCTAGCT...
,
Final_Plasmid,ATGCGATCGATCG...GCTAGCTAGCTAG...

Output

Reading input from: fragments.csv
Found 17 candidate fragments
Target: Final Plasmid (6441 bp)

Aligning fragments (min identity: 90%)...

==========================================================================================
MATCH ANALYSIS (sorted by alignment score)
==========================================================================================
Fragment    Score  Aligned   Identity   Coverage           Position                Flags
------------------------------------------------------------------------------------------
17           5966     2983     100.0%      62.7%    3458-6441 [+] *
16           3976     1988     100.0%      66.7%      4463-6451 [+]               SUBSET
17           3518     1759     100.0%      37.0%         0-1759 [+]
12           3424     1712     100.0%     100.0%      1754-3466 [+]
------------------------------------------------------------------------------------------

==================================================
REQUIRED FRAGMENTS: 17, 12
==================================================

COVERAGE: 100% complete (13 bp of overlap at junctions)

How It Works

FragmentFinder uses minimap2 (via mappy) for Smith-Waterman alignment, which tolerates:

  • Sequencing errors and SNPs
  • Small insertions/deletions
  • Assembly scars

This makes it robust for real-world lab data where sequences may not be perfect matches.

Options

Option Description
--linear Treat target as linear (default: circular)
--min-identity 0.95 Set minimum identity threshold (default: 0.90)
--list-only Only output required fragment names
--no-visual Skip the ASCII visualization
--show-all Include subsets and decoys in output

Key Features

Circular Plasmid Support

FragmentFinder treats targets as circular by default. Fragments that span the origin (wrap around from end to beginning) are correctly detected.

Adapter Detection

Automatically detects common adapter sequences (like Golden Gate BsaI sites) and strips them before matching. Works with mixed datasets where some fragments have adapters and some don't.

Subset Detection

Identifies when one fragment is completely contained within another. The smaller fragment is flagged as SUBSET and excluded from the required list.

Both Strand Matching

Checks both forward and reverse complement orientations for every fragment.

Running Tests

# Run all tests
pytest tests/ -v

# Run with coverage
pytest tests/ --cov=fragmentfinder

Use Cases

  • Plasmid verification: Confirm which fragments from your freezer box match a target construct
  • Assembly planning: Identify the minimum set of fragments needed
  • Troubleshooting: Find coverage gaps or unexpected matches
  • Quality control: Detect low-quality or chimeric fragments

Limitations

  • Cannot resolve truly ambiguous placements without wet lab confirmation
  • Does not validate restriction sites or assembly scars
  • Assumes fragments are provided in correct reading frame

License

MIT

Authors

  • Austin Morrissey
  • Co-developed with Claude (Anthropic)

About

CLI tool for identifying DNA fragments needed to assemble a target plasmid

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages