Plasmid detection and assembly in genomic and metagenomic data sets