1fe319ef49168c2c7c8d10a7c426c1414521d164,cnvlib/tabio/genepred.py,,read_refflat,#Any#Any#Any#,80
Before Change
dframe = (dframe.groupby(by=["chromosome", "strand", "gene"],
as_index=False, group_keys=False, sort=False)
.apply(_merge_overlapping))
return dframe
def _merge_overlapping(dframe):
Merge overlapping regions within a group.
After Change
raise ValueError("Arguments "cds" and "exons" are mutually exclusive")
cols_shared = ["gene", "accession", "chromosome", "strand"]
converters = None
if exons:
cols_rest = ["_start_tx", "_end_tx", // Transcription
"_start_cds", "_end_cds", // Coding region
"_exon_count", "exon_starts", "exon_ends"]
converters = {"exon_starts": _split_commas, "exon_ends": _split_commas}
elif cds:
// Use CDS instead of transcription region
cols_rest = ["_start_tx", "_end_tx",
"start", "end",
"_exon_count", "_exon_starts", "_exon_ends"]
else:
cols_rest = ["start", "end",
"_start_cds", "_end_cds",
"_exon_count", "_exon_starts", "_exon_ends"]
colnames = cols_shared + cols_rest
usecols = [c for c in colnames if not c.startswith("_")]
// Parse the file contents
dframe = pd.read_table(infile, header=None, na_filter=False,
names=colnames, usecols=usecols,
dtype={c: str for c in cols_shared},
converters=converters)
// Calculate values for output columns
if exons:
dframe = pd.DataFrame.from_records(_split_exons(dframe),
columns=cols_shared + ["start", "end"])
dframe["start"] = dframe["start"].astype("int")
dframe["end"] = dframe["end"].astype("int")
return (dframe.assign(start=dframe.start - 1)
.sort_values(["chromosome", "start", "end"])
.reset_index(drop=True))
def _split_commas(field):
return field.rstrip(",").split(",")
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: etal/cnvkit
Commit Name: 1fe319ef49168c2c7c8d10a7c426c1414521d164
Time: 2016-10-28
Author: eric.talevich@gmail.com
File Name: cnvlib/tabio/genepred.py
Class Name:
Method Name: read_refflat
Project Name: metagenome-atlas/atlas
Commit Name: 3ab0e54a3ce88c7018a34192461dd47e5867d357
Time: 2017-01-28
Author: joe.brown@pnnl.gov
File Name: atlas/tables.py
Class Name:
Method Name: col_split
Project Name: etal/cnvkit
Commit Name: 11d76fd4eb2ef5ecb3c062ff4ff4f39d64ae5741
Time: 2016-11-24
Author: eric.talevich@gmail.com
File Name: cnvlib/genome/_merge.py
Class Name:
Method Name: _merge