# How to export contact map/distance map in Julia?

**URL:** <https://discourse.julialang.org/t/how-to-export-contact-map-distance-map-in-julia/90574>\
**Category:** General Usage\
**Tags:** question\
**Created:** [November 21, 2022, 6:47am UTC](https://discourse.julialang.org/t/how-to-export-contact-map-distance-map-in-julia/90574 "2022-11-21T06:47:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dangda](https://avatars.discourse-cdn.com/v4/letter/d/bc8723/32.png) [@dangda](https://discourse.julialang.org/u/dangda)\
**Post date:** [November 21, 2022, 6:47am UTC](https://discourse.julialang.org/t/how-to-export-contact-map-distance-map-in-julia/90574/1 "2022-11-21T06:47:15Z")

</div>

I draw a protein contact map and distance map in Julia.  
I want to export it in a csv/png form but it doesn’t work at all.  
This is how I write the code

> > using BioStructures  
> > julia\> struc=read(“ranked\_0.pdb”,PDB)  
> > cProteinStructure ranked\_0.pdb with 1 models, 1 chains (A), 398 residues, 6267 atoms

> > julia\> calphas=collectatoms(struc[‘A’],calphaselector)  
> > 398-element Vector{AbstractAtom}:  
> > Atom CA with serial 5, coordinates [-36.089, 66.106, 25.299]  
> > Atom CA with serial 22, coordinates [-33.821, 64.881, 22.365]  
> > Atom CA with serial 44, coordinates [-33.557, 62.444, 20.056]  
> > Atom CA with serial 68, coordinates [-32.879, 58.931, 18.504]  
> > Atom CA with serial 90, coordinates [-29.619, 58.508, 16.472]  
> > Atom CA with serial 109, coordinates [-30.364, 57.074, 13.005]  
> > Atom CA with serial 120, coordinates [-28.582, 54.105, 11.366]  
> > Atom CA with serial 142, coordinates [-25.95, 54.934, 8.729]  
> > Atom CA with serial 152, coordinates [-25.746, 52.003, 6.279]  
> > Atom CA with serial 171, coordinates [-22.186, 52.037, 4.888]  
> > Atom CA with serial 190, coordinates [-22.536, 50.445, 1.448]  
> > Atom CA with serial 201, coordinates [-19.07, 48.955, 0.906]  
> > Atom CA with serial 211, coordinates [-19.304, 47.721, -2.701]  
> > ⋮  
> > Atom CA with serial 6078, coordinates [-30.501, 3.783, 9.927]  
> > Atom CA with serial 6093, coordinates [-30.924, 7.529, 10.661]  
> > Atom CA with serial 6117, coordinates [-28.57, 8.891, 13.374]  
> > Atom CA with serial 6136, coordinates [-30.304, 12.0, 14.818]  
> > Atom CA with serial 6147, coordinates [-29.161, 14.746, 17.23]  
> > Atom CA with serial 6154, coordinates [-26.384, 13.957, 19.761]  
> > Atom CA with serial 6168, coordinates [-26.4, 10.132, 19.458]  
> > Atom CA with serial 6179, coordinates [-23.963, 7.201, 19.425]  
> > Atom CA with serial 6193, coordinates [-24.374, 4.256, 17.037]  
> > Atom CA with serial 6214, coordinates [-22.595, 1.092, 18.252]  
> > Atom CA with serial 6228, coordinates [-20.864, -0.796, 15.39]  
> > Atom CA with serial 6247, coordinates [-19.446, -3.617, 17.623]

> > julia\> dm=DistanceMap(calphas)  
> > Distance map of size (398, 398)
