Single Cell API Reference
This page provides API reference documentation for the Single Cell module, which contains functions and classes for working with individual neuron models.
Utility Functions
bmtool.singlecell.load_biophys1()
Load the Biophys1 template from BMTK if it hasn't been loaded yet.
This function checks if the Biophys1 object exists in NEURON's h namespace. If not, it loads the necessary HOC files for Allen Cell Types Database models.
Notes:
This is primarily used for working with cell models from the Allen Cell Types Database.
Source code in bmtool/singlecell.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
|
bmtool.singlecell.load_allen_database_cells(morphology, dynamic_params, model_processing='aibs_perisomatic')
Create a cell model from the Allen Cell Types Database.
Parameters:
morphology : str Path to the morphology file (SWC or ASC format). dynamic_params : str Path to the JSON file containing biophysical parameters. model_processing : str, optional Model processing type from the AllenCellType database. Default is 'aibs_perisomatic'.
Returns:
callable A function that, when called, creates and returns a NEURON cell object with the specified morphology and biophysical properties.
Notes:
This function creates a closure that loads and returns a cell when called. The cell is created using the Allen Institute's modeling framework.
Source code in bmtool/singlecell.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
|
bmtool.singlecell.get_target_site(cell, sec=('soma', 0), loc=0.5, site='')
Get a segment and its section from a cell model using flexible section specification.
Parameters:
cell : NEURON cell object The cell object to access sections from. sec : str, int, or tuple, optional Section specification, which can be: - str: Section name (defaults to index 0 if multiple sections) - int: Index into the 'all' section list - tuple: (section_name, index) for accessing indexed sections Default is ('soma', 0). loc : float, optional Location along the section (0-1), default is 0.5 (middle of section). site : str, optional Name of the site for error messages (e.g., 'injection', 'recording').
Returns:
tuple (segment, section) at the specified location
Raises:
ValueError If the section cannot be found or accessed.
Source code in bmtool/singlecell.py
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
|
Current Clamp
bmtool.singlecell.CurrentClamp
Bases: object
Source code in bmtool/singlecell.py
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 |
|
__init__(template_name, post_init_function=None, record_sec='soma', record_loc=0.5, threshold=None, inj_sec='soma', inj_loc=0.5, inj_amp=100.0, inj_delay=100.0, inj_dur=1000.0, tstop=1000.0)
Initialize a current clamp simulation environment.
Parameters:
template_name : str or callable Either the name of the cell template located in HOC or a function that creates and returns a cell object. post_init_function : str, optional Function of the cell to be called after initialization. record_sec : str, int, or tuple, optional Section to record from. Can be: - str: Section name (defaults to index 0 if multiple sections) - int: Index into the 'all' section list - tuple: (section_name, index) for accessing indexed sections Default is 'soma'. record_loc : float, optional Location (0-1) within section to record from. Default is 0.5. threshold : float, optional Spike threshold (mV). If specified, spikes are detected and counted. inj_sec : str, int, or tuple, optional Section for current injection. Same format as record_sec. Default is 'soma'. inj_loc : float, optional Location (0-1) within section for current injection. Default is 0.5. inj_amp : float, optional Current injection amplitude (pA). Default is 100.0. inj_delay : float, optional Start time for current injection (ms). Default is 100.0. inj_dur : float, optional Duration of current injection (ms). Default is 1000.0. tstop : float, optional Total simulation time (ms). Default is 1000.0. Will be extended if necessary to include the full current injection.
Source code in bmtool/singlecell.py
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 |
|
setup()
Set up the simulation environment for current clamp experiments.
This method: 1. Creates the current clamp stimulus at the specified injection site 2. Sets up voltage recording at the specified recording site 3. Creates vectors to store time and voltage data
Notes:
Sets self.cell_src as the current clamp object that can be accessed later.
Source code in bmtool/singlecell.py
178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 |
|
execute()
Run the current clamp simulation and return recorded data.
This method: 1. Sets up the simulation duration 2. Initializes and runs the NEURON simulation 3. Converts recorded vectors to Python lists
Returns:
tuple (time_vector, voltage_vector) where: - time_vector: List of time points (ms) - voltage_vector: List of membrane potentials (mV) at those time points
Source code in bmtool/singlecell.py
213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 |
|
Passive Properties
bmtool.singlecell.Passive
Bases: CurrentClamp
Source code in bmtool/singlecell.py
242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 |
|
__init__(template_name, inj_amp=-100.0, inj_delay=200.0, inj_dur=1000.0, tstop=1200.0, method=None, **kwargs)
Initialize a passive membrane property simulation environment.
Parameters:
template_name : str or callable Either the name of the cell template located in HOC or a function that creates and returns a cell object. inj_amp : float, optional Current injection amplitude (pA). Default is -100.0 (negative to measure passive properties). inj_delay : float, optional Start time for current injection (ms). Default is 200.0. inj_dur : float, optional Duration of current injection (ms). Default is 1000.0. tstop : float, optional Total simulation time (ms). Default is 1200.0. method : str, optional Method to estimate membrane time constant: - 'simple': Find the time to reach 0.632 of voltage change - 'exp': Fit a single exponential curve - 'exp2': Fit a double exponential curve Default is None, which uses 'simple' when calculations are performed. **kwargs : Additional keyword arguments to pass to the parent CurrentClamp constructor.
Notes:
This class is designed for measuring passive membrane properties including input resistance and membrane time constant.
Raises:
AssertionError If inj_amp is zero (must be non-zero to measure passive properties).
Source code in bmtool/singlecell.py
243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 |
|
tau_simple()
Calculate membrane time constant using the simple 0.632 criterion method.
This method calculates the membrane time constant by finding the time it takes for the membrane potential to reach 63.2% (1-1/e) of its final value after a step current injection.
Returns:
callable A function that prints the calculation details when called.
Notes:
Sets the following attributes: - tau: The calculated membrane time constant in ms
Source code in bmtool/singlecell.py
287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 |
|
tau_single_exponential()
Calculate membrane time constant by fitting a single exponential curve.
This method: 1. Identifies the peak response (for sag characterization) 2. Falls back to simple method for initial estimate 3. Fits a single exponential function to the membrane potential response 4. Sets tau to the exponential time constant
Returns:
callable A function that prints the calculation details when called.
Notes:
Sets the following attributes: - tau: The calculated membrane time constant in ms - t_peak, v_peak: Time and voltage of peak response - v_sag: Sag potential (difference between peak and steady-state) - v_max_diff: Maximum potential difference from rest - sag_norm: Normalized sag ratio - popt: Optimized parameters from curve fitting - pcov: Covariance matrix of the optimization
Source code in bmtool/singlecell.py
342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 |
|
tau_double_exponential()
Calculate membrane time constant by fitting a double exponential curve.
This method is useful for cells with sag responses that cannot be fitted well with a single exponential.
Returns:
callable A function that prints the calculation details when called.
Notes:
Sets the following attributes: - tau: The calculated membrane time constant (the slower of the two time constants) - t_peak, v_peak: Time and voltage of peak response - v_sag: Sag potential (difference between peak and steady-state) - v_max_diff: Maximum potential difference from rest - sag_norm: Normalized sag ratio - popt: Optimized parameters from curve fitting - pcov: Covariance matrix of the optimization
Source code in bmtool/singlecell.py
428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 |
|
double_exponential_fit()
Get the double exponential fit values for plotting.
Returns:
tuple (time_vector, fitted_values) where: - time_vector: Time points starting from rest time - fitted_values: Membrane potential values predicted by the double exponential function
Source code in bmtool/singlecell.py
481 482 483 484 485 486 487 488 489 490 491 492 493 494 |
|
single_exponential_fit()
Get the single exponential fit values for plotting.
Returns:
tuple (time_vector, fitted_values) where: - time_vector: Time points starting from rest time - fitted_values: Membrane potential values predicted by the single exponential function
Source code in bmtool/singlecell.py
496 497 498 499 500 501 502 503 504 505 506 507 508 509 |
|
execute()
Run the simulation and calculate passive membrane properties.
This method: 1. Runs the NEURON simulation 2. Extracts membrane potential at rest and steady-state 3. Calculates input resistance from the step response 4. Calculates membrane time constant using the specified method 5. Prints detailed calculations for educational purposes
Returns:
tuple (time_vector, voltage_vector) from the simulation
Notes:
Sets several attributes including: - v_rest: Resting membrane potential - r_in: Input resistance in MOhms - tau: Membrane time constant in ms
Source code in bmtool/singlecell.py
511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 |
|
Frequency-Current (F-I) Analysis
bmtool.singlecell.FI
Bases: object
Source code in bmtool/singlecell.py
571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 |
|
__init__(template_name, post_init_function=None, i_start=0.0, i_stop=1050.0, i_increment=100.0, tstart=50.0, tdur=1000.0, threshold=0.0, record_sec='soma', record_loc=0.5, inj_sec='soma', inj_loc=0.5)
Initialize a frequency-current (F-I) curve simulation environment.
Parameters:
template_name : str or callable Either the name of the cell template located in HOC or a function that creates and returns a cell object. post_init_function : str, optional Function of the cell to be called after initialization. i_start : float, optional Initial current injection amplitude (pA). Default is 0.0. i_stop : float, optional Maximum current injection amplitude (pA). Default is 1050.0. i_increment : float, optional Amplitude increment between trials (pA). Default is 100.0. tstart : float, optional Current injection start time (ms). Default is 50.0. tdur : float, optional Current injection duration (ms). Default is 1000.0. threshold : float, optional Spike threshold (mV). Default is 0.0. record_sec : str, int, or tuple, optional Section to record from. Same format as in CurrentClamp. Default is 'soma'. record_loc : float, optional Location (0-1) within section to record from. Default is 0.5. inj_sec : str, int, or tuple, optional Section for current injection. Same format as record_sec. Default is 'soma'. inj_loc : float, optional Location (0-1) within section for current injection. Default is 0.5.
Notes:
This class creates multiple instances of the cell model, one for each current amplitude to be tested, allowing all simulations to be run in a single call to NEURON's run() function.
Source code in bmtool/singlecell.py
572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 |
|
setup()
Set up the simulation environment for frequency-current (F-I) analysis.
For each current amplitude to be tested, this method: 1. Creates a current source at the injection site 2. Sets up spike detection at the recording site 3. Creates vectors to record spike times
Notes:
This preparation allows multiple simulations to be run with different current amplitudes in a single call to h.run().
Source code in bmtool/singlecell.py
644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 |
|
execute()
Run the simulation and count spikes for each current amplitude.
This method: 1. Initializes and runs a single NEURON simulation that evaluates all current amplitudes 2. Counts spikes for each current amplitude 3. Prints a summary of results in tabular format
Returns:
tuple (current_amplitudes, spike_counts) where: - current_amplitudes: List of current injection amplitudes (nA) - spike_counts: List of spike counts corresponding to each amplitude
Source code in bmtool/singlecell.py
677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 |
|
Impedance Analysis
bmtool.singlecell.ZAP
Bases: CurrentClamp
Source code in bmtool/singlecell.py
712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 |
|
__init__(template_name, inj_amp=100.0, inj_delay=200.0, inj_dur=15000.0, tstop=15500.0, fstart=0.0, fend=15.0, chirp_type=None, **kwargs)
Initialize a ZAP (impedance amplitude profile) simulation environment.
Parameters:
template_name : str or callable Either the name of the cell template located in HOC or a function that creates and returns a cell object. inj_amp : float, optional Current injection amplitude (pA). Default is 100.0. inj_delay : float, optional Start time for current injection (ms). Default is 200.0. inj_dur : float, optional Duration of current injection (ms). Default is 15000.0. tstop : float, optional Total simulation time (ms). Default is 15500.0. fstart : float, optional Starting frequency of the chirp current (Hz). Default is 0.0. fend : float, optional Ending frequency of the chirp current (Hz). Default is 15.0. chirp_type : str, optional Type of chirp current determining how frequency increases over time: - 'linear': Linear increase in frequency (default if None) - 'exponential': Exponential increase in frequency **kwargs : Additional keyword arguments to pass to the parent CurrentClamp constructor.
Notes:
This class is designed for measuring the frequency-dependent impedance profile of a neuron using a chirp current that sweeps through frequencies.
Raises:
AssertionError - If inj_amp is zero - If chirp_type is 'exponential' and either fstart or fend is <= 0
Source code in bmtool/singlecell.py
713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 |
|
linear_chirp(t, f0, f1)
Generate a chirp current with linearly increasing frequency.
Parameters:
t : ndarray Time vector (ms) f0 : float Start frequency (kHz) f1 : float End frequency (kHz)
Returns:
ndarray Current values with amplitude self.inj_amp and frequency increasing linearly from f0 to f1 Hz over time t
Source code in bmtool/singlecell.py
764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 |
|
exponential_chirp(t, f0, f1)
Generate a chirp current with exponentially increasing frequency.
Parameters:
t : ndarray Time vector (ms) f0 : float Start frequency (kHz), must be > 0 f1 : float End frequency (kHz), must be > 0
Returns:
ndarray Current values with amplitude self.inj_amp and frequency increasing exponentially from f0 to f1 Hz over time t
Notes:
For exponential chirp, both f0 and f1 must be positive.
Source code in bmtool/singlecell.py
785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 |
|
zap_current()
Create a frequency-modulated (chirp) current for probing impedance.
This method: 1. Sets up time vectors for the simulation and current injection 2. Creates a chirp current based on the specified parameters (linear or exponential) 3. Prepares the current vector for NEURON playback
Notes:
The chirp current increases in frequency from fstart to fend Hz over the duration of the injection. This allows frequency-dependent impedance to be measured in a single simulation.
Source code in bmtool/singlecell.py
811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 |
|
get_impedance(smooth=1)
Calculate and extract the frequency-dependent impedance profile.
This method: 1. Filters the impedance to the frequency range of interest 2. Optionally applies smoothing to reduce noise 3. Identifies the resonant frequency (peak impedance)
Parameters:
smooth : int, optional Window size for smoothing the impedance. Default is 1 (no smoothing).
Returns:
tuple (frequencies, impedance_values) in the range of interest
Notes:
Sets self.peak_freq to the resonant frequency (frequency of maximum impedance).
Source code in bmtool/singlecell.py
843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 |
|
execute()
Run the ZAP simulation and calculate the impedance profile.
This method: 1. Sets up the chirp current 2. Runs the NEURON simulation 3. Calculates the impedance using FFT 4. Prints a summary of the frequency range and analysis method
Returns:
tuple (time_vector, voltage_vector) from the simulation
Notes:
Sets several attributes including: - Z: Complex impedance values (from FFT) - freq: Frequency values for the impedance profile - impedance: Absolute impedance values
Source code in bmtool/singlecell.py
875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 |
|
Cell Profiler
bmtool.singlecell.Profiler
All in one single cell profiler
Source code in bmtool/singlecell.py
925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 |
|
__init__(template_dir=None, mechanism_dir=None, dt=None)
Source code in bmtool/singlecell.py
927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 |
|
load_templates(hoc_template_file=None)
Source code in bmtool/singlecell.py
944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 |
|
passive_properties(template_name, post_init_function=None, record_sec='soma', inj_sec='soma', plot=True, method=None, **kwargs)
Calculates passive properties for the specified cell template_name
Parameters
template_name: str or callable name of the cell template located in hoc or a function that creates and returns a cell object post_init_function: str function of the cell to be called after the cell has been initialized (like insert_mechs(123)) record_sec: str section of the cell you want to record spikes from (default: soma) inj_sec: str section of the cell you want to inject current to (default: soma) plot: bool automatically plot the cell profile method: str method to estimate membrane time constant (see Passive) **kwargs: extra key word arguments for Passive()
Returns time (ms), membrane voltage (mV)
Source code in bmtool/singlecell.py
969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 |
|
current_injection(template_name, post_init_function=None, record_sec='soma', inj_sec='soma', plot=True, **kwargs)
Source code in bmtool/singlecell.py
1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 |
|
fi_curve(template_name, post_init_function=None, record_sec='soma', inj_sec='soma', plot=True, **kwargs)
Calculates an FI curve for the specified cell template_name
Parameters
template_name: str or callable name of the cell template located in hoc or a function that creates and returns a cell object post_init_function: str function of the cell to be called after the cell has been initialized (like insert_mechs(123)) record_sec: str section of the cell you want to record spikes from (default: soma) inj_sec: str section of the cell you want to inject current to (default: soma) plot: bool automatically plot an fi curve
Returns the injection amplitudes (nA) used, number of spikes per amplitude supplied list(amps), list(# of spikes)
Source code in bmtool/singlecell.py
1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 |
|
impedance_amplitude_profile(template_name, post_init_function=None, record_sec='soma', inj_sec='soma', plot=True, chirp_type=None, smooth=9, **kwargs)
chirp_type: str Type of chirp current (see ZAP) smooth: int Window size for smoothing the impedance in frequency domain **kwargs: extra key word arguments for ZAP()
Source code in bmtool/singlecell.py
1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 |
|
Helper Functions
bmtool.singlecell.run_and_plot(sim, title=None, xlabel='Time (ms)', ylabel='Membrane Potential (mV)', plot=True, plot_injection_only=False)
Helper function for running simulation and plot sim: instance of the simulation class in this module title, xlabel, ylabel: plot labels plot: whether or not to plot plot_injection_only: plot only the injection duration Return: outputs by sim.execute()
Source code in bmtool/singlecell.py
1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 |
|