diff --git a/mrdna/readers/__init__.py b/mrdna/readers/__init__.py index 33b2a79ed913fbde104aaab3ce17831870f3295e..1b61d775fcc4d8b7d5aa11dfd9a29bb9932471e8 100644 --- a/mrdna/readers/__init__.py +++ b/mrdna/readers/__init__.py @@ -33,12 +33,17 @@ def read_list(infile,**model_parameters): from .segmentmodel_from_lists import model_from_basepair_stack_3prime return model_from_basepair_stack_3prime(coords, bp, stack, three_prime) +def read_pandas(df,coordinate_col="r",bp_col="bp",stack_col="stack",three_prime_col="threeprime", + seq_col=None,orientation_col=None): + from .segmentmodel_from_lists import model_from_pandas + return model_from_pandas(df,coordinate_col,bp_col,stack_col,three_prime_col, + seq_col,orientation_col), def read_atomic_pdb(pdb_file, **model_parameters): from .segmentmodel_from_pdb import SegmentModelFromPdb return SegmentModelFromPdb(pdb_file) -def read_oxdna(coordinate_file, topology_file, idealized_coordinate_file=None, **model_parameters): +def read_oxdna(coordinate_file, topology_file, virt2nuc=None, **model_parameters): """ Idealized coordinate file: coordinates for detecting stacks and base pairs, defaults to coordinate_file """ - from .segmentmodel_from_oxdna import mrdna_model_from_oxdna - return mrdna_model_from_oxdna(coordinate_file, topology_file, idealized_coordinate_file, **model_parameters) + from .segmentmodel_from_oxdna_pinyi import mrdna_model_from_oxdna + return mrdna_model_from_oxdna(coordinate_file, topology_file,virt2nuc, **model_parameters) diff --git a/mrdna/readers/segmentmodel_from_cadnano.py b/mrdna/readers/segmentmodel_from_cadnano.py index 7021722e887437e5cdae7c3004e405fe0a47530d..f8127e715c6cf43f558a5488d963f840b06c8e2f 100644 --- a/mrdna/readers/segmentmodel_from_cadnano.py +++ b/mrdna/readers/segmentmodel_from_cadnano.py @@ -222,5 +222,4 @@ def mrdna_model_from_cadnano(json_file,seq=None,**model_parameters): stack=np.array((list(nt_prop["stack"]))) orientation=np.array(list(nt_prop["orientation"])) model = model_from_basepair_stack_3prime( r, bp, stack, three_prime, seq, orientation, **model_parameters ) - model._dataframe=nt_prop return model diff --git a/mrdna/readers/segmentmodel_from_lists.py b/mrdna/readers/segmentmodel_from_lists.py index 922b3d247aa93390fed412abfe30eca33d95e0d7..3f96df780c4227f4e4b4120f3decd59fd80c1875 100644 --- a/mrdna/readers/segmentmodel_from_lists.py +++ b/mrdna/readers/segmentmodel_from_lists.py @@ -230,7 +230,7 @@ def set_splines(seg, coordinate, hid, hmap, hrank, fwd, basepair, orientation=No def model_from_basepair_stack_3prime(coordinate, basepair, stack, three_prime, - sequence=None, orientation=None, + sequence=None, orientation=None, max_basepairs_per_bead = 5, max_nucleotides_per_bead = 5, local_twist = False, @@ -471,10 +471,12 @@ def model_from_basepair_stack_3prime(coordinate, basepair, stack, three_prime, model._reader_list_hmap = hmap model._reader_list_fwd = fwd model._reader_list_hrank = hrank - + df=pd.DataFrame({"r":coordinate,"bp":basepair,"stack":stack,"threeprime":three_prime,"seq":sequence,"orientation":orientation,"fwd":fwd,"hmap":hmap,"hrank":hrank,}) if sequence is None: for s in model.segments: s.randomize_unset_sequence() + + model._dataframe=df return model @@ -527,7 +529,6 @@ def model_from_pandas(df,coordinate_col="r",bp_col="bp",stack_col="stack",three_ local_twist = local_twist, dimensions=dimensions **model_parameters) - model._dataframe=df return model except: print("cannot phrase DataFrame, aborted")